lundi 3 avril 2017

How to draw matches in Opencv?

I have matched two vectors of descriptors of two images:

cv::Ptr<BinaryDescriptorMatcher> bdm = BinaryDescriptorMatcher::createBinaryDescriptorMatcher();
std::vector<std::vector<cv::DMatch> >  matches;
float maxDist = 10.0;
bdm->radiusMatch(descr2, descr1, matches, maxDist);
// descr1 from image1, descr2 from image2
std::vector<char> mask(matches.size(), 1);

But now I want to draw the found matches from the two images.

This does not work:

drawMatches(gmlimg, keylines, walls, keylines1, matches, outImg, cv::Scalar::all(-1), cv::Scalar::all(-1), mask, DrawLinesMatchesFlags::DEFAULT);

And this neither:

drawLineMatches(gmlimg, keylines, walls, keylines1, matches, outImg, cv::Scalar::all(-1), cv::Scalar::all(-1), mask, DrawLinesMatchesFlags::DEFAULT);

Aucun commentaire:

Enregistrer un commentaire