Ask Your Question
1

FeatureDetector giving conversion error on image set

asked 2012-11-22 04:54:08 -0600

ipunished gravatar image

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);

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2012-11-22 10:55:55 -0600

Maria Dimashova gravatar image

You have to pass

vector<vector<KeyPoint> > keypoints;

for a vector of images (see the part of the documentation you mentioned above).

edit flag offensive delete link more

Comments

Thank you. How could I have missed that..

ipunished gravatar imageipunished ( 2012-11-22 16:41:30 -0600 )edit

Question Tools

Stats

Asked: 2012-11-22 04:54:08 -0600

Seen: 467 times

Last updated: Nov 22 '12