好的,给出以下代码
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.
更多推荐
发布评论