Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Get the SIFT descriptor for specified point using OpenCV

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);
    keypoints.push_back(kp);

    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?