Lowe比率测试如何工作? [英] How does the Lowe's ratio test work?

查看:229
本文介绍了Lowe比率测试如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一组N张图像,并且我已经计算了每个图像的SIFT描述符。我知道要计算不同功能之间的匹配。我听说过一种常见的方法是Lowe比率测试,但我不知道它是如何工作的。有人可以向我解释吗?

解决方案

简短版本:第一张图片的每个关键点都与来自第二张图片。我们为每个关键点保留2个最佳匹配项(最佳匹配项=距离测量值最小的匹配项)。劳氏的测试检查出两个距离是否足够不同。如果不是,则将消除关键点,并且将不会将其用于进一步的计算。



长版:



David Lowe提出了一种简单的方法来过滤关键点匹配,方法是在次优匹配几乎相同的情况下消除匹配。请注意,尽管在计算机视觉的背景下得到了普及,但该方法并不与CV相关。在这里,我描述了该方法及其在计算机视觉环境中的实现方式。



让我们假设L1是图像1的关键点集,每个关键点包含列出关键点信息的描述,该信息的性质实际上取决于所使用的描述符算法。 L2是图像2的关键点集。典型的匹配算法将通过为L1中的每个关键点找到L2中最接近的匹配来工作。如果使用欧几里得距离,就像在Lowe的论文中那样,这意味着集合L2中的关键点与欧洲第一点中的关键点之间的欧几里得距离最小。



只需设置一个阈值并消除距离大于该阈值的所有配对。但这不是那么简单,因为描述符中的并非所有变量都是判别式的:两个关键点可能具有较小的距离度量,因为其描述符中的大多数变量具有相似的值,但是这些变量可能与实际匹配无关。总是可以对描述符的变量进行加权,以使更具区分性的特征更多地计数。 Lowe提出了一个更简单的解决方案,如下所述。



首先,我们将L1中的关键点与L2中的两个关键点进行匹配。假设图像1中的一个关键点不能与图像2中的一个等效点相同,我们可以推断出这两个匹配项都不都是正确的:至少其中之一是错误的。按照Lowe的推论,距离最小的匹配是良好匹配,距离第二小的匹配则等于随机噪声(基本速率)。如果无法将良好匹配与噪音区分开,则应拒绝良好匹配,因为它不会带来任何有趣的信息。因此,总的原则是,最好的比赛与第二名的比赛之间必须有足够的差异。使用两个距离的比率,通常表示为:

  if distance1< distance2 * a_constant然后.... 

其中distance1是关键点与其最佳匹配之间的距离, distance2是关键点与其第二好的匹配项之间的距离。 小于符号的使用可能会造成一些混淆,但是当考虑到较小的距离表示该点更近时,这将变得显而易见。在OpenCV世界中,knnMatch函数会将匹配项从最佳返回到最差,因此第一场比赛的距离更短。问题实际上是多小?为了弄清楚,我们将distance2乘以必须在0到1之间的常数,从而减小distance2的值。然后我们再看一下distance1:它仍然小于distance2吗?如果是,则它通过了测试,并将被添加到好点列表中。如果不是这样,就必须消除它。



这样可以解释小于部分,但是乘法呢?由于我们正在研究距离之间的差异,为什么不仅仅使用distance1和distance2之间的实际数学差异?尽管从技术上讲我们可以做到,但最终的差异将是绝对的,它太依赖于描述符中的变量,我们使用的距离测量的类型等。如果提取描述的代码发生变化并影响所有距离测量,该怎么办? ?简而言之,执行distance1-distance2的鲁棒性较差,需要经常进行调整,并使方法的比较更加复杂。



外卖消息:Lowe的解决方案之所以有趣,不仅因为其简单性,而且在很多方面都与算法无关。


Suppose I have a set of N images and I have already computed the SIFT descriptors of each image. I know would like to compute the matches between the different features. I have heard that a common approach is the Lowe's ratio test but I cannot understand how it works. Can someone explain it to me?

解决方案

Short version: each keypoint of the first image is matched with a number of keypoints from the second image. We keep the 2 best matches for each keypoint (best matches = the ones with the smallest distance measurement). Lowe's test checks that the two distances are sufficiently different. If they are not, then the keypoint is eliminated and will not be used for further calculations.

Long version:

David Lowe proposed a simple method for filtering keypoint matches by eliminating matches when the second-best match is almost as good. Do note that, although popularized in the context of computer vision, this method is not tied to CV. Here I describe the method, and how it is implemented/applied in the context of computer vision.

Let's suppose that L1 is the set of keypoints of image 1, each keypoint having a description that lists information about the keypoint, the nature of that info really depending on the descriptor algorithm that was used. And L2 is the set of keypoints for image 2. A typical matching algorithm will work by finding, for each keypoint in L1, the closest match in L2. If using Euclidian distance, like in Lowe's paper, this means the keypoint from set L2 that has the smallest Euclidian distance from the keypoint in L1.

Here we could be tempted to just set a threshold and eliminate all the pairings where the distance is above that threshold. But it's not that simple because not all variables inside the descriptors are as "discriminant": two keypoints could have a small distance measurement because most of the variables inside their descriptors have similar values, but then those variables could be irrelevant to the actual matching. One could always add weighting to the variables of the descriptors so that the more discriminating traits "count" more. Lowe proposes a much simpler solution, described below.

First, we match the keypoints in L1 with two keypoints in L2. Working from the assumption that a keypoint in image 1 can't have more than one equivalent in image 2, we deduce that those two matches can't both be right: at least one of them is wrong. Following Lowe's reasoning, the match with the smallest distance is the "good" match, and the match with the second-smallest distance the equivalent of random noise, a base rate of sorts. If the "good" match can't be distinguished from noise, then the "good" match should be rejected because it does not bring anything interesting, information-wise. So the general principle is that there needs to be enough difference between the best and second-best matches.

How the concept of "enough difference" is operationalized is important: Lowe uses a ratio of the two distances, often expressed a such:

if distance1 < distance2 * a_constant then ....

Where distance1 is the distance between the keypoint and its best match, and distance2 is the distance between the keypoint and its second-best match. The use of a "smalled than" sign can be somewhat confusing, but that becomes obvious when taking into consideration that a smaller distance means that the point is closer. In OpenCV world, the knnMatch function will return the matches from best to worst, so the 1st match will have a smaller distance. The question is really "how smaller?" To figure that out we multiply distance2 by a constant that has to be between 0 and 1, thus decreasing the value of distance2. Then we look at distance1 again: is it still smaller than distance2? If it is, then it passed the test and will be added to the list of good points. If not, it must be eliminated.

So that explans the "smaller than" part, but what about the multiplication? Since we are looking at the difference between the distances, why not just use an actual mathematical difference between distance1 and distance2? Although technically we could, the resulting difference would be in absolute terms, it would be too dependent on the variables inside the descriptors, the type of distance measurement that we use, etc. What if the code for extracting descriptions changes, affecting all distance measurements? In short, doing distance1 - distance2 would be less robust, would require frequent tweaking and would make methodological comparisons more complicated. It's all about the ratio.

Take-away message: Lowe's solution is interesting not only because of it's simplicity, but because it is in many ways algorithm-agnostic.

这篇关于Lowe比率测试如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆