Berlian
Berlian

Reputation: 55

How to declare BruteForceMatcher in OPENCV 3.x C++ Visual Studio 2015

I'm using Open CV 3.2 and work in Visual Studio 2015 Platform.

In this tutorial they use BruteForceMatcher.

And based on this answer, I know there are several differences of using opencv 2.x and 3.x.

So, is there any suggestion how to change

BruteForceMatcher<L2<float> > matcher;
vector<DMatch> matches;
matcher.match(descriptors1, descriptors2, matches);

into Open CV 3.x form?

Upvotes: 0

Views: 645

Answers (1)

Lakshya Kejriwal
Lakshya Kejriwal

Reputation: 1388

You can try the following code

Ptr<cv::DescriptorMatcher> matcher(new cv::BFMatcher(cv::NORM_HAMMING, true));
vector<DMatch> matches;
matcher->match(descriptors1, descriptors2, matches);

Upvotes: 3

Related Questions