This is very poorly documented in the code for openCV, but the default settings for flannBasedMatcher are in these two functions
Flann :: SearchParams (); // 32 checks, 0, sorted = true Flann :: KDTreeIndexParams (); // uses 4 randomized KD trees
The default distance function is FLANN_DIST_L2.
I think this code snippet explains why you cannot change it yet printf("[WARNING] You are using cv::flann::Index (or cv::flann::GenericIndex) and have also changed the distance using cvflann::set_distance_type. This is no longer working as expected cv::flann::Index always uses L2). You should create the index templated on the distance, for example for L1 distance use: GenericIndex< L1<float> > \n"); \
printf("[WARNING] You are using cv::flann::Index (or cv::flann::GenericIndex) and have also changed the distance using cvflann::set_distance_type. This is no longer working as expected cv::flann::Index always uses L2). You should create the index templated on the distance, for example for L1 distance use: GenericIndex< L1<float> > \n"); \
source share