【问题标题】:OpenCV: ‘SiftDescriptorExtractor’ was not declared in this scopeOpenCV:“SiftDescriptorExtractor”未在此范围内声明
【发布时间】:2015-02-01 16:52:21
【问题描述】:

总的来说,我是 OpenCV 的新手,过去几天一直在尝试一些示例。我已经成功地让哈里斯角检测来处理一些测试图像。我的下一个测试是看看我是否可以根据使用 SIFT 的 harris 检测匹配两个图像。

这是我找到哈里斯角的方法:

GoodFeaturesToTrackDetector harris_detector(1000, 0.01, 10, 3, true);
vector<KeyPoint> keypoints1, keypoints2; 

harris_detector.detect(img1, keypoints1);
harris_detector.detect(img2, keypoints2);

这很好用。我的下一个目标是匹配 img1 和 img2 之间的特征,我尝试使用 SIFT。但是,当我尝试为 SIFT 声明提取器时:

SiftDescriptorExtractor extractor;

我收到以下错误:

错误:“SiftDescriptorExtractor”未在此范围内声明 SiftDescriptorExtractor 提取器;

我做错了什么?

提前致谢。

【问题讨论】:

    标签: c++ opencv computer-vision sift


    【解决方案1】:

    确保您拥有#include &lt;features2d.hpp&gt;。 在某些版本的 OpenCV 中,Sift 位于&lt;opencv2/nonfree/features2d.hpp&gt;

    【讨论】:

    • 我有#include 。我还需要包含 吗?
    猜你喜欢
    • 1970-01-01
    • 2019-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-20
    相关资源
    最近更新 更多