FlannBasedMatcher使用哪种距离函数以及如何更改它?

时间:2012-06-05 12:39:33

标签: opencv flann

openCVs flannBasedMatcher使用哪个距离函数,是否可以更改默认值?在Muja和Lowe的原始flann的用户手册中有一些不同的距离类型(flann_distance_t),我没有在opencv中看到一个方法来改变它们: - /

1 个答案:

答案 0 :(得分:3)

openCV的代码记录很少,但flannBasedMatcher的默认设置可以在这两个函数中找到

FLANN :: SearchParams(); // 32次检查,0,sorted = true 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"); \