OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Wed, 25 Oct 2017 09:50:48 -0500Brute Force Matching with L2-Normhttp://answers.opencv.org/question/176917/brute-force-matching-with-l2-norm/When I use the default method L2-Norm in cv::BFMatcher on an own defined descriptor, is it irrelevant which position every value in my descriptor vector has?
So when I have a descriptor vector (1, 1, 2, 2, 6, 8, 4, 5, ...) according to http://mathworld.wolfram.com/L2-Norm.html it should have the same L2-Norm as (6, 2, 5, 4, 2, 8, 2, 1, 1...).
When I would use NORM_HAMMING is the position then relevant?
Am I right or completely confused?Wed, 25 Oct 2017 07:48:00 -0500http://answers.opencv.org/question/176917/brute-force-matching-with-l2-norm/Answer by berak for <p>When I use the default method L2-Norm in cv::BFMatcher on an own defined descriptor, is it irrelevant which position every value in my descriptor vector has?</p>
<p>So when I have a descriptor vector (1, 1, 2, 2, 6, 8, 4, 5, ...) according to <a href="http://mathworld.wolfram.com/L2-Norm.html">http://mathworld.wolfram.com/L2-Norm....</a> it should have the same L2-Norm as (6, 2, 5, 4, 2, 8, 2, 1, 1...).</p>
<p>When I would use NORM_HAMMING is the position then relevant?
Am I right or completely confused?</p>
http://answers.opencv.org/question/176917/brute-force-matching-with-l2-norm/?answer=176923#post-id-176923for both L2 and HAMMING norm, the position of the values is irrelevant, as long as you stay **consistant** with the ordering
(x1*x2 + y1*y2 + z1*z2) == (y1*y2 + x1*x2 + z1*z2) == (z1*z2 + y1*y2 + x1*x2) == ...
let me try another drawing:
// ok.
(x1 y1 z1)
(x2 y2 z2)
// still ok (same result as above):
(z1 y1 x1)
(z2 y2 x2)
// not ok:
(x1 y1 z1)
(z2 y2 x2)
your example above will "fail" for both norms, since you arbitrarily change the order in **one** of the vectors. again, if you use the same permutation for **all** of your vectors, the results will be the same.Wed, 25 Oct 2017 09:50:48 -0500http://answers.opencv.org/question/176917/brute-force-matching-with-l2-norm/?answer=176923#post-id-176923