I am trying to write a c++
program using the SIFT
. I have already installed and built the opencv_contrib-master
module as some have suggested that the latest version of OpenCV
(version 3.0 which i have) doesn't have this module. I can physically locate the nonfree folder as well as the featuures2d file in it but every time i try to compile, i get the following errors inside of the 'features2d.hpp
' file itself:
/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;
There are a total of 26 errors but most of them are the 'vector not declared
' type although i have included vector.h
as well. The main program recognizes siftfeaturedetector but the errors are all coming from the nonfree/features2d.hpp
file. Any suggestions what might be wrong here?
I'm also very new to OpenCV
and apologize for my lack of technical details.
Thanks