Ask Your Question

Get the SIFT descriptor for specified point using OpenCV

asked 2014-12-03 21:19:02 -0500

tidy gravatar image

I want get the SIFT feature for specified points. These points is gotten by hand not by KeyPoint Detector. My question is: I only know the position of the points but have no idea about the size and angle value. How should I set this value?

Here is my code:

int main()
    SiftDescriptorExtractor extractor;
    Mat descriptors;
    std::vector<KeyPoint> keypoints;

    // set keypoint position and size: should I set size parameter to 32 for 32x32 patch?
    KeyPoint kp(50, 60, 32);

    extractor.compute( img_object, keypoints, descriptors );

    return 0;

Should I set the size param of KeyPoint to 32 for 32x32 patch. Is this implementation reasonable?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-12-05 06:27:06 -0500

JohannesZ gravatar image

You should read the original SIFT paper first. The size specifies the layer in the gaussian pyramid (octave & sub-layers) in which the corner-like feature recieves the highest value in the response-function. Also, the extracted gradients in the neighborhood of the feature lead to the direction of the detected keypoint.

As you can see, it is very hard to guess some "handwritten values". Maybe you try to use DSIFT or some kind of other feature detector for your project?

edit flag offensive delete link more


Thanks for your advice! I will try DSIFT.

tidy gravatar imagetidy ( 2014-12-08 00:27:40 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2014-12-03 21:19:02 -0500

Seen: 358 times

Last updated: Dec 05 '14