“未定义的标识符:SurfFeatureDetector”问题解决办法

来源:互联网 发布:余承东老婆 周芳 知乎 编辑:程序博客网 时间:2024/05/21 10:25

 在VS中使用opencv2.4.X版本的时候,如果使用SurfFeatureDetector(或者SiftFeatureDetector)做特征点检测的时候,按照官方文档上的示例代码include头文件为:opencv2/features2d/features2d.hpp,则会出现如下报错:errorC2065: “SurfFeatureDetector”: 未声明的标识符。

 

1、实际上2.4.X版本的SurfFeatureDetector(或者SiftFeatureDetector)包含在opencv2/nonfree/features2d.hpp中,所以应该include这个头文件,并且在“项目属性->链接器->输入->附加依赖项”中加入库文件:opencv_nonfree240d.lib(以opencv2.4.0为例子)。

 

2、同时,特征点匹配中如果使用到BruteForceMatcher则应该include头文件:opencv2/legacy/legacy.hpp,并在“项目属性->链接器->输入->附加依赖项”中加入库文件:opencv_legacy240d.lib(以opencv2.4.0为例子)。

 

3、此外,特征点匹配中如果用到FlannBasedMatcher则应该include头文件:opencv2/features2d/features2d.hpp,并在“项目属性->链接器->输入->附加依赖项”中加入库文件:opencv_features2d240d.lib(以opencv2.4.0为例子)。



引自:http://blog.csdn.net/holybin/article/details/41144705


0 0