Which distance function does FlannBasedMatcher use and how to change it?

删除回忆录丶 提交于 2019-12-03 16:40:39

This is very poorly documented in the code for openCV but the default settings for the flannBasedMatcher are found in these two functions

flann::SearchParams(); //32 checks, 0, sorted=true flann::KDTreeIndexParams(); //uses 4 randomized KD trees

The distance function by default is FLANN_DIST_L2.

I think this bit of code explains why you can't yet change it 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"); \

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!