FeatureDetector giving conversion error on image set
I was able to successfully load a number of images into a vector, vector<Mat>
. The images once loaded in can be displayed with the imread
function.
The problem is that I want to apply SIFT on this set of images using the second variant, as mentioned in the documentation:
void FeatureDetector::detect(const vector<Mat>& images, vector<vector<KeyPoint>>& keypoints, const vector<Mat>& masks=vector<Mat>() ) const
This is producing the following error:
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 &'
The code I am using:
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);
The error is detected at get_keypoints->detect(images , keypoints);