From 16e20e5c73d2ab6ba26fea315c7f96bd1efa6daa Mon Sep 17 00:00:00 2001 From: laurentBerger Date: Sat, 9 May 2015 10:29:53 +0200 Subject: [PATCH] An another improvement? --- samples/cpp/matchmethod_orb_akaze_brisk.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/samples/cpp/matchmethod_orb_akaze_brisk.cpp b/samples/cpp/matchmethod_orb_akaze_brisk.cpp index 7b595b50bf..4e3884d690 100644 --- a/samples/cpp/matchmethod_orb_akaze_brisk.cpp +++ b/samples/cpp/matchmethod_orb_akaze_brisk.cpp @@ -97,12 +97,18 @@ int main(int argc, char *argv[]) // Match method loop for (itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); itMatcher++){ descriptorMatcher = DescriptorMatcher::create(*itMatcher); - if ((*itMatcher == "BruteForce-Hamming" || *itMatcher == "BruteForce-Hamming(2)") && (b->descriptorType() == CV_32F || b->defaultNorm() <= NORM_L2SQR) ) + if ((*itMatcher == "BruteForce-Hamming" || *itMatcher == "BruteForce-Hamming(2)") && (b->descriptorType() == CV_32F || b->defaultNorm() <= NORM_L2SQR)) { cout << "**************************************************************************\n"; cout << "It's strange. You should use Hamming distance only for a binary descriptor\n"; cout << "**************************************************************************\n"; } + if ((*itMatcher == "BruteForce" || *itMatcher == "BruteForce-L1") && (b->defaultNorm() >= NORM_HAMMING)) + { + cout << "**************************************************************************\n"; + cout << "It's strange. You shouldn't use L1 or L2 distance for a binary descriptor\n"; + cout << "**************************************************************************\n"; + } try { descriptorMatcher->match(descImg1, descImg2, matches, Mat());