加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 在OpenCV 3.0中计算密集SIFT功能

发布时间:2020-12-16 05:46:41 所属栏目:百科 来源:网络整理
导读:从3.0版开始,DenseFeatureDetector不再可用.有人可以告诉我如何在OpenCV 3.0中计算密集SIFT功能吗?我在文档中找不到它. 非常感谢你提前! 解决方法 以下是我在OpenCV 3 C中使用密集SIFT的方法: SiftDescriptorExtractor sift;vectorKeyPoint keypoints; //
从3.0版开始,DenseFeatureDetector不再可用.有人可以告诉我如何在OpenCV 3.0中计算密集SIFT功能吗?我在文档中找不到它.

非常感谢你提前!

解决方法

以下是我在OpenCV 3 C中使用密集SIFT的方法:
SiftDescriptorExtractor sift;

vector<KeyPoint> keypoints; // keypoint storage
Mat descriptors; // descriptor storage

// manual keypoint grid

int step = 10; // 10 pixels spacing between kp's

for (int y=step; y<img.rows-step; y+=step){
    for (int x=step; x<img.cols-step; x+=step){

        // x,y,radius
        keypoints.push_back(KeyPoint(float(x),float(y),float(step)));
    }
}

// compute descriptors

sift.compute(img,keypoints,descriptors);

复制自:
http://answers.opencv.org/question/73165/compute-dense-sift-features-in-opencv-30/?answer=73178#post-id-73178

似乎运作良好

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读