# NORM_HAMMING2 vs NORM_HAMMING

I'm trying to use ORB features with a cv::BFMatcher. ORB is based on binary descriptors so HAMMING must be the choice, but I'm not sure I understand the difference between NORM_HAMMING2 vs NORM_HAMMING and witch one is the right choice.

I made some test but I couldn't find any reliable difference.

NORM_HAMMING should be used with ORB, BRISK and BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor description)

WTA_K - [...] Other possible values are 3 and 4. [...] Such output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, denoted as NORM_HAMMING2 (2 bits per bin).

In other words the right choice is the one that matches your ORB configuration (NORM_HAMMING when WTA_K==2, and NORM_HAMMING2 when WTA_K==3 or WTA_K==4), otherwise you'll wind up with incorrect norms and correspondingly poorer/inconsistent matching performance.

• Nice! I thought It was just a faster algorithm. I didn't notice it was already explained in the WTA_K documentation. – Albert Garcias Mirabent Jan 30 '16 at 17:15