Ask Your Question

how to calculate SIFT/SURF descriptor for 1 point?

asked 2012-08-23 07:11:35 -0500

mrgloom gravatar image

I want to calculate SIFT/SURF descriptor for 1 point that I define by myself, how can I do this?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-08-23 07:33:26 -0500

Ben gravatar image

updated 2012-08-23 07:36:05 -0500

KeyPoint kp;    
// init keypoint with values here (coordinates, size, angle..)

vector<KeyPoint> keypoints;

SurfDescriptorExtractor extractor;
Mat descriptors;
extractor.compute( img, keypoints, descriptors );
edit flag offensive delete link more


I only know x,y coordinate, how can I choose other parameters?

mrgloom gravatar imagemrgloom ( 2012-08-23 08:33:22 -0500 )edit

It depends on what you want to do. You can set fixed values for every point but you will loose rotation/scale invariance.

Ben gravatar imageBen ( 2012-08-23 08:45:49 -0500 )edit

I want to input point descriptor to SVM to classify points.

mrgloom gravatar imagemrgloom ( 2012-08-23 09:03:31 -0500 )edit

And why do you need self-defined keypoints?

Ben gravatar imageBen ( 2012-08-23 09:44:01 -0500 )edit

for example I put point at eye location and train SVM to detect eyes.

mrgloom gravatar imagemrgloom ( 2012-08-24 01:04:59 -0500 )edit

So you have to mark the points manually. You could mark a circle, then you would have a size for your feature. And set the angle to 0. But if you want do detect eyes in a picture, this will only work, if some keypoint detector detects a point with the same size and angle.

Ben gravatar imageBen ( 2012-08-24 03:21:43 -0500 )edit

I know that sometimes people use different detector and descriptor(for axample Harris for corner detection+SIFT for descriptor extraction), isn't it points that detector and descriptor extractor are independent?

mrgloom gravatar imagemrgloom ( 2012-08-24 08:03:10 -0500 )edit

Yes, you can use any combination of detectors and descriptors. But using different detectors will generally yield different keypoints and thus different descriptors. If you detect features with MSER, you won't get the same keypoints (with the same size/angle) as you marked manually.

Ben gravatar imageBen ( 2012-08-24 08:52:15 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2012-08-23 07:11:35 -0500

Seen: 2,094 times

Last updated: Aug 23 '12