多数の画像をベクトルに正常にロードできましたvector<Mat>
. 一度読み込まれた画像は、関数で表示できますimread
。
問題は、ドキュメントに記載されているように、2 番目のバリアントを使用して、この一連の画像に SIFT を適用することです。
void FeatureDetector::detect(const vector<Mat>& images, vector<vector<KeyPoint>>& keypoints, const vector<Mat>& masks=vector<Mat>() ) const
これにより、次のエラーが発生します。
error C2664: 'void cv::FeatureDetector::detect(const cv::Mat &,std::vector<_Ty> &,const cv::Mat &) const' : cannot convert parameter 1 from 'std::vector<_Ty>' to 'const cv::Mat &'
私が使用しているコード:
vector<Mat> images;
/* code to add all images to vector not shown as its messy but it was performed with FindFirstFile of windows.h. All images loaded correctly as they can be read by imread*/
initModule_nonfree();
Ptr<FeatureDetector> get_keypoints = FeatureDetector::create("SIFT");
vector<KeyPoint> keypoints;
get_keypoints->detect(images , keypoints);
エラーは次の場所で検出されます。get_keypoints->detect(images , keypoints);