Difference between cv2.NORM_L2 and cv2.NORM_L1 in opencv python
Asked Answered
B

1

10

I am using sift algorithm from python extra modules for some feature matching. Although one thing I did not understand is the concept behind the normType passed to the BFMatcher. i.e Which ones have to be used in what case?

Any help will be invaluable

Briefless answered 29/9, 2015 at 16:43 Comment(0)
L
19

From WolframAlpha NormL1 and NormL2:

Given a vector:

enter image description here

Norm L1 is the taxicab (or manhattan) distance (sum of absolute values):

enter image description here

while Norm L2 is the euclidean distance (square root of sum of squares):

enter image description here

The type of norm tells the BFMatcher how to compute the distances between every two features.

The NORM L1 is in general much faster to compute (mostly because you don't compute the square root). The NORM L2 is more accurate.

You can find a nice comparison here.

Liquefacient answered 29/9, 2015 at 17:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.