Get the SIFT descriptor for specified point using OpenCV

﹥>﹥吖頭↗ 提交于 2019-12-11 09:39:18

问题


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()
{
    Mat img_object = imread("img/test.jpg", 0);

    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?


回答1:


Usually, keypoint detectors work on a local neighbourhood around a point. This is the size field of OpenCV's KeyPoint class. The angle field is the dominant orientation of the keypoint (this could be set to -1, note).

OpenCV KeyPoint class

Another reference here.



来源:https://stackoverflow.com/questions/27285210/get-the-sift-descriptor-for-specified-point-using-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!