【发布时间】:2016-04-04 21:43:43
【问题描述】:
我已经阅读了问题、源代码和其他示例,但我一生都无法理解函数中 Distance d = Distance() 参数的含义
它在this question 的 cmets 中得到解决,但我在任何地方都找不到距离类型。我已导入以下文件:
#include "opencv2/contrib/contrib.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/flann/flann.hpp"
我检查了cv、cvflann 和cv::flann 命名空间,但找不到任何东西。
这是我的代码:
int tmp = cv::flann::hierarchicalClustering<cv::L2<float>>(descriptors, centers, params, ______ );
___ 显然是最后一个参数所在的位置。我尝试过类似cv::L2<float>() 的方法,但这也不起作用。
在源代码中它看起来像一个模板。
我也试过了:
int tmp = cv::flann::hierarchicalClustering<float, float>(descriptors, centers, params);
我得到错误“没有重载函数的实例“cv::flann::hierachicalClustering”与参数列表匹配。参数类型是:(cv::Mat, cv::Mat, cv::KMeansIndexParams)。
我使用的是 OpenCV 2.4.11。
有什么想法吗?
FLANN user manual 中还有更多文档。看起来它是逐字复制到 OpenCV 中的。
【问题讨论】: