这距离函数确实openCVs flannBasedMatcher使用,是有可能更改默认? 在从由Muja和Lowe原始FLANN用户手册也有一些不同的距离的类型(flann_distance_t)和我没有看到在OpenCV中的方法,以改变它们: - /
Answer 1:
这是非常糟糕记录在OpenCV的代码,但对于flannBasedMatcher的默认设置是在这两个函数发现
FLANN :: SearchParams(); // 32次检查,0,排序=真FLANN :: KDTreeIndexParams(); //使用4个随机KD树
默认情况下,距离函数是FLANN_DIST_L2。
我觉得这段代码解释了为什么还不能改变它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"); \