- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我尝试在 BFMatcher 上实现 knnMatch,如下所示:
BFMatcher matcher(NORM_L2, true);
vector<DMatch> matches;
//matcher.match(descriptors1, descriptors2, matches);
matcher.knnMatch(descriptors1, descriptors2, matches, 2);
并收到以下错误:
fiducialMain.cpp: In function ‘void fiducialCalc(cv::Mat, cv::Mat, cv::Mat&, cv::Mat&, int&)’:
fiducialMain.cpp:98:56: error: no matching function for call to ‘cv::BFMatcher::knnMatch(cv::Mat&, cv::Mat&, std::vector<cv::DMatch>&, int)’
matcher.knnMatch(descriptors1, descriptors2, matches,2);
^
fiducialMain.cpp:98:56: note: candidates are:
In file included from fiducialMain.cpp:15:0:
/usr/local/include/opencv2/features2d/features2d.hpp:1116:18: note: void cv::DescriptorMatcher::knnMatch(const cv::Mat&, const cv::Mat&, std::vector<std::vector<cv::DMatch> >&, int, const cv::Mat&, bool) const
CV_WRAP void knnMatch( const Mat& queryDescriptors, const Mat& trainDescriptors,
^
/usr/local/include/opencv2/features2d/features2d.hpp:1116:18: note: no known conversion for argument 3 from ‘std::vector<cv::DMatch>’ to ‘std::vector<std::vector<cv::DMatch> >&’
/usr/local/include/opencv2/features2d/features2d.hpp:1130:18: note: void cv::DescriptorMatcher::knnMatch(const cv::Mat&, std::vector<std::vector<cv::DMatch> >&, int, const std::vector<cv::Mat>&, bool)
CV_WRAP void knnMatch( const Mat& queryDescriptors, CV_OUT vector<vector<DMatch> >& matches, int k,
^
/usr/local/include/opencv2/features2d/features2d.hpp:1130:18: note: no known conversion for argument 2 from ‘cv::Mat’ to ‘std::vector<std::vector<cv::DMatch> >&’
谁能解释这个错误?
最佳答案
请再看看the docs
而普通的匹配函数有一个vector<DMatch>
结果,
knnMatch(大声说:k-nearest-neighbours!)产生几个(k)个 vector ,因此你需要一个:
vector < vector
结果
关于c++ - BFMatcher knnMatch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28729880/
在 knnMatch 方法中,我们计算到这个第 n 个最近邻居的距离。我想知道他们在计算哪个距离。无论是欧几里得距离还是什么?谢谢 最佳答案 好吧,这个问题是一种转贴。你最好先搜索一下再问。 Here
我使用 knnMatch 匹配图像的关键点,并且由于我的匹配计数通常超过 10,000,knnMatch 需要花费大量时间来运行,我必须对目录中的每个图像都执行此操作,我目前正在使用 for 循环执行
我尝试在 BFMatcher 上实现 knnMatch,如下所示: BFMatcher matcher(NORM_L2, true); vector matches; //matcher.match(
该代码用于在网络摄像头捕获的图像上使用FLANN匹配器实现基于SIFT的算法。由于某种原因导致的错误是在knnMatch中,我们在其中处理捕获的图像。附件的图像链接显示了导致错误的行。如果有人可以为该
我正在编写一个基于 surf 的图像匹配算法。我用 400 hessian 阈值初始化 surf: surf = cv2.SURF(400) 并进行了 flann 匹配。 但它运行得太慢(在大量图像上
我正在尝试实现一个非常简单的程序来查找两个图像之间的相似性。 我正在为此任务使用 ORB 特征检测器和图像描述符,我正在使用 knnMatch 识别匹配项: FeatureDetector detec
我有一些 python 代码来比较两个图像: detector_FeatureDetector_1 = cv2.FastFeatureDetector_create() detector_Feat
我正在使用 SURF,我正在尝试两者 FlannBasedMatcher 和 BruteForceMatcher 我看到我需要设置好匹配 matcher.knnMatch(,,2); // with
基本上我有: BruteForceMatcher>().knnMatch(descriptor1,descriptor2,matches,2); 为了只获得良好的匹配,我解析了所有“匹配” vecto
我是 OpenCV java 新手,我有一个 Android 应用程序,可以使用 ORB FeatureDetector 和 DescriptorExtractor 匹配两个图像。我使用 Descri
OpenCV 2.4.5、CUDA 5.0 我试图将我的 SURF 匹配器从 CPU 传输到 GPU,但得到了如此奇怪的结果。我将 knnMatch 和 findHomography + perspe
有没有人碰巧知道为什么 OpenCV 2 DescriptorMatcher::radiusMatch()和 knnMatch()拿个vector>& matches ?我有点困惑为什么它不只是一个
我想用Python+OpenCV匹配两张图片。我已经使用 SURF 从它们中提取关键点和描述符。现在,我需要匹配这些描述符,因此我决定使用 Flann Matcher。 flann_params =
首先我要说的是,到目前为止,我已经使用 this very interesting post 建立了其中的很大一部分。关于这个问题。 在提到的帖子中,该示例使用网络摄像头和 UI 窗口来实时查看输出。
我通过 jni(带有 contrib 的 OpenCV)编译我的 Android 项目。 一切正常,但我有一个问题。每个来源都做得很好,但只有 cv::DescriptorMatcher::knnMa
我正在尝试在实时视频源中使用 SIFT 执行对象检测,并且正在围绕感兴趣的对象绘制轮廓该程序有时运行良好,但我经常遇到以下错误:- Traceback (most recent call last):
这是我的代码的快照, Matrix mask; int k = 2; VectorOfKeyPoint modelKeyPoints; VectorOfKeyPoint observedKeyPoin
我正在尝试在 android studio 项目中使用 opencv native 库。我收到函数 knnMatch undefined reference 的错误。 我已将 openCVLibrar
我正在尝试使用 ORB 检测器/描述符和 Flann 或蛮力匹配器在更大的目标图像(allimg.jpg 包含 3 张面孔)中识别源图像(c1.jpg- 一张脸)。 c1.jpg 是通过裁剪/复制从
我基本上是使用 SURF 从相似图像中提取许多关键点并将它们添加到 BFMatcher(NORM_L2) 在运行时,我可能会使用 matcher->add(myNewDescriptors); 向我的
我是一名优秀的程序员,十分优秀!