cv :: flann :: index :: knnsearch索引和dists的值(cv::flann::index::knnsearch values of indices and dists)

编程入门 行业动态 更新时间:2024-10-28 00:14:13
cv :: flann :: index :: knnsearch索引和dists的值(cv::flann::index::knnsearch values of indices and dists)

好的,给出以下代码

index.knnSearch(mat,indices,dists,3); for (int i = 0; i < indices.rows; i++ ) { indices.at<int>(i,0) // this is the index of the match indices.at<int>(i,1) // ????? what is this? indices.at<int>(i,2) // and this? }

对于dists,我如何处理每行中的3个值? 如何使其成为有用的比例或百分比匹配? 在索引中我需要知道500个中有多少描述符匹配,我确信数据显示不知何故,但我不明白。 请帮忙

ok given the following code

index.knnSearch(mat,indices,dists,3); for (int i = 0; i < indices.rows; i++ ) { indices.at<int>(i,0) // this is the index of the match indices.at<int>(i,1) // ????? what is this? indices.at<int>(i,2) // and this? }

also for dists, what do I do with the 3 values in each row? how do I make it into a useful ratio or percentage match? in the indices I need to know how many descriptors out of 500 matched, I'm sure that data shows that somehow, but I don't understand it. Please help

最满意答案

假设这是电话: -

knnSearch(mat,indices,dists,N);

注 - N是调用者传递的值。

回来的时候

索引 ”指的是具有算法找到的“N”个最近邻居的阵列。

dists ”是指相同指数的距离。

因此,在问题中提到的情况下, N = 3 ,并且返回3个最近的邻居以及它们的距离。 你如何使用它真的直到用例。

Suppose this is the call:-

knnSearch(mat,indices,dists,N);

Note - N is a value passed by the caller.

On return,

"indices" refer to the array having the "N" closest neighbours found by the algorithm.

"dists" refers to the distance of the same indices.

So, in the case mentioned in the question, N=3, and the 3 closest neighbours are returned along with their distances. How you use it it really upto the use-case.

更多推荐

本文发布于:2023-08-07 14:56:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464920.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:索引   index   cv   flann   knnsearch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!