2

c++を使ってプログラムを書いてみましたSIFT。の最新バージョン(私が持っているバージョン3.0)にはこのモジュールがないことopencv_contrib-masterを示唆している人もいるので、私はすでにモジュールをインストールして構築しました。OpenCVnonfree フォルダーとその中の 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 個のエラーがありますが、それらのほとんどは ' vector not declared' タイプですが、私も含めvector.hました。メイン プログラムは siftfeaturedetector を認識しますが、エラーはすべてファイルから発生していnonfree/features2d.hppます。ここで間違っている可能性のある提案はありますか?
また、私は非常に新しいものOpenCVであり、技術的な詳細が不足していることをお詫びします. ありがとう

4

0 に答える 0