2

我正在尝试c++使用SIFT. 我已经安装并构建了该opencv_contrib-master模块,因为有些人建议最新版本的OpenCV(我拥有的 3.0 版)没有这个模块。我可以在物理上找到非自由文件夹以及其中的 feature2d 文件,但每次我尝试编译时,我都会在“ features2d.hpp”文件本身中得到以下错误:

/usr/include/opencv2/nonfree/features2d.hpp:73: error: expected ',' or '...' before '<' token vector<KeyPoint>& keypoints) const;
/usr/include/opencv2/nonfree/features2d.hpp:73: error: 'vector' has not been declared
/usr/include/opencv2/nonfree/features2d.hpp:77: error: 'vector' has not been declared vector<KeyPoint>& keypoints,
/usr/include/opencv2/nonfree/features2d.hpp:77: error: expected ',' or '...' before '<' token
/usr/include/opencv2/nonfree/features2d.hpp:83: error: 'vector' has not been declared void buildGaussianPyramid( const Mat& base, vector<Mat>& pyr, int nOctaves ) const; vector<KeyPoint>& keypoints,
/usr/include/opencv2/nonfree/features2d.hpp:76: error: 'void cv::SIFT::operator()(cv::InputArray, cv::InputArray, int) const' cannot be overloaded void operator()(InputArray img, InputArray mask,
/usr/include/opencv2/nonfree/features2d.hpp:72: error: with 'void cv::SIFT::operator()(cv::InputArray, cv::InputArray, int) const'
 void operator()(InputArray img, InputArray mask,  vector<KeyPoint>& keypoints) const;

总共有 26 个错误,但其中大多数是 ' vector not declared' 类型,尽管我也包括在内vector.h。主程序识别 siftfeaturedetector 但错误都来自nonfree/features2d.hpp文件。任何建议这里可能有什么问题?
我也很陌生,OpenCV并为我缺乏技术细节而道歉。谢谢

4

0 回答 0