通过欧氏距离进行 SIFT 特征匹配
SIFT 特征匹配是通过基于欧几里德距离的最近邻方法完成的。有人可以解释一下吗?有计算吗?那么有人可以帮我计算 SIFT 特征向量的欧几里德距离吗?我想保存计算出的欧几里德距离,以提供具有更多特征(例如图像的圆度和颜色)的神经网络。
SIFT feature matching is done through a Euclidean-distance based nearest neighbor approach. Can some please explain this? Is there a calculation? If then can someone help me to calculate the Euclidean distance for my SIFT feature vector? I want to save calculated Euclidean distances to feed for neural network with some more features like roundness and color of images.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过欧氏距离进行 SIFT 特征匹配并不是一件困难的任务。该过程可以解释如下:
提取两个图像的 SIFT 关键点描述符。
从一张图像中获取一个关键点描述符(参考描述符)。
2.1 现在,找到参考描述符与另一图像的所有关键点描述符之间的欧几里德距离。
2.2 因此,您可以得到从参考描述符到 image2 中所有关键点描述符的欧几里得距离。按从小到大的顺序排列。(表示图像1中的关键点到图像2中的关键点的最近距离)
2.3 现在,设置一些阈值T(主要在0.3到0.7的范围内)。
2.4 取第一个最近距离与第二个最近距离的比率,如果它低于阈值 T,那么它是匹配的,因此,您保存该索引。否则,没有匹配。
对 image1 中的所有关键点描述符重复此操作。
SIFT feature matching through Euclidean distance is not a difficult task. The process can be explained as follows:
Extract the SIFT keypoint descriptors for both images.
Take one keypoint descriptor (reference descriptor) from one image.
2.1 Now, find the Euclidean distances between the reference descriptor and all keypoint descriptors of the other image.
2.2 Consequently, you have the Euclidean distances from the reference descriptor to all the keypoint descriptors in image2. Arrange them in ascending order.(It implies the nearest distances for keypoint in image1 to keypoints in image2)
2.3 Now, set some threshold T ( mostly in the range of 0.3 to 0.7).
2.4 Take the ratio of the first nearest distance to the second nearest distance and if it is below the threshold T, then it is a match and, therefore, you save that index. Otherwise, there is no match.
Repeat this for all keypoint descriptors in image1.
我认为你的疑问是欧几里德距离是什么。欧几里德距离是在欧几里德(或二维)平面中看到的两点之间的距离。
对于二维平面来说,它非常直观,但由于 SIFT 描述符是 128 维的向量,因此变得很棘手。您只需坚持公式(https://en.wikipedia.org/wiki/Euclidean_distance)
这是我计算欧氏距离的代码:
该代码将找到从第一张图像上的点“i”到第二张图像中所有遇到的点(在本例中为“j”)的距离。我将这个距离存储在向量 euclideanDist 中。
单元阵列 SIFT1 和 SIFT2 包含每个图像的描述符。
I think your doubt is what the euclidean distance is. The euclidean distance is the distance between two points as seen in a Euclidean (or 2 dimensional) plane.
It is very visual fo a two dimensional plane, but as SIFT descriptors are vectors of 128 dimension it gets tricky. You just have to stick to the formula (https://en.wikipedia.org/wiki/Euclidean_distance)
This is my code for calculating the euclidean distance:
The code will find the distance from point 'i' on the first image to all of the encountered points in the 2nd image, 'j' in this case. I store this distances in the vector euclideanDist.
The cell-arrays SIFT1 and SIFT2 contain the descriptors of each image.