Ask Your Question

How Brute-Force Matcher works?

asked 2017-03-14 20:17:22 -0500

Kelvin gravatar image

updated 2017-03-14 20:20:13 -0500

1 - Can someone explain to me with more details how the Brute-Force Matcher works?

The documentation explains very well how to use this method, but it is not too detailed on how the method works.

The documentation basically explains it:

Brute-Force matcher is simple. It takes the descriptor of one feature in first set and is matched with all other features in second set using some distance calculation. And the closest one is returned.

Just one more thing, about the distance measurement that is used, the documentation says:

By default, it is cv2.NORM_L2. It is good for SIFT, SURF etc (cv2.NORM_L1 is also there).

2 - What distance measurement is cv2.NORM_L2? Is it the euclidean distance?

Note: I am testing it with SIFT.


edit retag flag offensive close merge delete


As I kown,OpenCV is opensource,and you can read it's source code if you want to find the answers.

jsxyhelu gravatar imagejsxyhelu ( 2017-03-15 00:18:02 -0500 )edit

I want to understand the concept, not the code itself.

Kelvin gravatar imageKelvin ( 2017-03-15 11:57:56 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2017-03-15 04:07:04 -0500

kbarni gravatar image

updated 2017-03-15 04:08:41 -0500

I think the description is pretty accurate.

1. For a given keypoint K1 from the first set (image), it takes every keypoint in the second set and calculates the distance. The keypoint K2 with the smallest distance will be considered its pair.

If you enable cross-checking, the pair is accepted only if K1 is the closest to K2 from the first set.

2. Yes, NORM_L2 is the euclidean distance (=sum(da²)). The NORM_L1 is the sum of the distances on each dimension (=sum(abs(da))).

edit flag offensive delete link more


Thanks a lot @kbarni.

Kelvin gravatar imageKelvin ( 2017-03-15 11:58:55 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-03-14 20:17:22 -0500

Seen: 613 times

Last updated: Mar 15 '17