BFMatcher knnMatch

J'essaie de mettre en œuvre knnMatch sur BFMatcher comme suit:

BFMatcher matcher(NORM_L2, true);
vector<DMatch> matches;
//matcher.match(descriptors1, descriptors2, matches);
matcher.knnMatch(descriptors1, descriptors2, matches, 2);

Et recevez l'erreur suivante:

fiducialMain.cpp: In function void fiducialCalc(cv::Mat, cv::Mat, cv::Mat&, cv::Mat&, int&)’:
fiducialMain.cpp:98:56: error: no matching function for call to cv::BFMatcher::knnMatch(cv::Mat&, cv::Mat&, std::vector<cv::DMatch>&, int)’
matcher.knnMatch(descriptors1, descriptors2, matches,2);
^
fiducialMain.cpp:98:56: note: candidates are:
In file included from fiducialMain.cpp:15:0:
/usr/local/include/opencv2/features2d/features2d.hpp:1116:18: note: void cv::DescriptorMatcher::knnMatch(const cv::Mat&, const cv::Mat&, std::vector<std::vector<cv::DMatch> >&, int, const cv::Mat&, bool) const
CV_WRAP void knnMatch( const Mat& queryDescriptors, const Mat& trainDescriptors,
^
/usr/local/include/opencv2/features2d/features2d.hpp:1116:18: note:   no known conversion for argument 3 from std::vector<cv::DMatch>’ to std::vector<std::vector<cv::DMatch> >&’
/usr/local/include/opencv2/features2d/features2d.hpp:1130:18: note: void cv::DescriptorMatcher::knnMatch(const cv::Mat&, std::vector<std::vector<cv::DMatch> >&, int, const std::vector<cv::Mat>&, bool)
CV_WRAP void knnMatch( const Mat& queryDescriptors, CV_OUT vector<vector<DMatch> >& matches, int k,
^
/usr/local/include/opencv2/features2d/features2d.hpp:1130:18: note:   no known conversion for argument 2 from cv::Mat to std::vector<std::vector<cv::DMatch> >&’

Quelqu'un peut-il expliquer cette erreur?

OriginalL'auteur P3d0r | 2015-02-25