使用OpenCV获取指定点的SIFT描述符 [英] Get the SIFT descriptor for specified point using OpenCV

查看:694
本文介绍了使用OpenCV获取指定点的SIFT描述符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要获得指定点的SIFT功能。这些点是由手而不是由键盘检测器。我的问题是:我只知道点的位置,但不知道尺寸角度值。如何设置此值?



以下是我的代码:

  int main()
{
Mat img_object = imread(img / test.jpg,0);

SiftDescriptorExtractor extractor;
Mat描述符;
std :: vector< KeyPoint>关键点;

//设置keypoint位置和大小:对于32x32补丁,我应该将
// size参数设置为32吗?
KeyPoint kp(50,60,32);
keypoints.push_back(kp);

extractor.compute(img_object,keypoints,descriptors);

return 0;
}

对于32x32补丁,我应该将KeyPoint的大小参数设置为32。

解决方案

通常,关键点检测器在一个点周围的局部邻域上工作。这是OpenCV的 KeyPoint 类的 size 字段。 angle 字段是关键点的主导方向(可以设置为-1,注意)。



OpenCV KeyPoint类



这里另一个引用


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?

解决方案

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.

这篇关于使用OpenCV获取指定点的SIFT描述符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆