Ask Your Question

How can I change the norm used by cv::FlannBasedMatcher?

asked 2014-10-07 09:42:54 -0600

JohnyK. gravatar image

Hi, I use the following code to create a cv::FlannBasedMatcher.

new cv::FlannBasedMatcher(new cv::flann::LshIndexParams(6, 12, 2));

How can I change the norm used by the matcher?


edit retag flag offensive close merge delete



I am afraid that you cannot do that, if you see this documentation. You can instead do something about the KDTreeIndexParams, or SearchParams. See this for more info.

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-10-07 10:16:56 -0600 )edit

Basically there are these norm types defined in the cv2.NORM_L2,cv2.NORM_L1,cv2.NORM_HAMMING,cv2.NORM_HAMMING2. This documentation may help you :

Abhishek Kumar Annamraju gravatar imageAbhishek Kumar Annamraju ( 2014-10-07 11:41:43 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-10-08 03:33:18 -0600

thdrksdfthmn gravatar image

The norms are used for BFMatching (BruteForce). As you can see it is mentioned here:

"For BF matcher, first we have to create the BFMatcher object using cv2.BFMatcher(). It takes two optional params. First one is normType"


"For FLANN based matcher, we need to pass two dictionaries which specifies the algorithm to be used, its related parameters etc. First one is IndexParams. For various algorithms, the information to be passed is explained in FLANN docs."

edit flag offensive delete link more

Question Tools


Asked: 2014-10-07 09:42:54 -0600

Seen: 438 times

Last updated: Oct 08 '14