我正在尝试使用c++
编写SIFT
程序。我已经安装并构建了opencv_contrib-master
模块,因为有人建议最新版本的OpenCV
(我有3.0版本)没有这个模块。我可以在物理上找到nonfree文件夹以及其中的featuures2d文件,但每次我尝试编译时,我都会在' 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个错误,但其中大多数是&#39; vector not declared
&#39;类型虽然我也包括vector.h
。主程序识别siftfeaturedetector但错误全部来自nonfree/features2d.hpp
文件。有什么建议可能是错的吗?
我对OpenCV
也很新,并为我缺乏技术细节道歉。
感谢