【发布时间】:2016-05-05 16:09:54
【问题描述】:
目前我正在检查重复图像,所以我正在使用 ORB,第一部分几乎完成,我有两个图像的描述符向量,现在作为第二部分,我想知道我们如何计算使用汉明距离得分,说这些是重复的阈值应该是多少
img1 = gray_image15
img2 = gray_image25
# Initiate STAR detector
orb = cv2.ORB_create()
# find the keypoints with ORB
kp1 = orb.detect(img1,None)
kp2 = orb.detect(img2,None)
# compute the descriptors with ORB
kp1, des1 = orb.compute(img1, kp1)
kp2, des2 = orb.compute(img2, kp2)
matcher = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
matches = matcher.match(des1, des2)
# Sort them in the order of their distance.
matches = sorted(matches, key = lambda x:x.distance)
我只想知道这个过程的下一步,以便最终我可以打印是或否重复。我在 python 2.7 中使用 opencv3.0.0
【问题讨论】:
-
对于 c++ 实现使用:github.com/vonzhou/opencv/blob/master/match/ORB_match.cpp,对于 python 实现使用:stackoverflow.com/questions/11114349/…。希望这会对你有所帮助。
-
您好,您能告诉我们您认为“重复图像”的标准是什么吗?根据您的答案,解决方案可能会大不相同,它们可以是简单的方法,如直方图比较,也可以是复杂的算法,如词袋、图像散列。如果你只想知道如何使用 OBR 来找出相似的对象(如果是单个对象),这就像 Sagar 说的那样很容易。
标签: python-2.7 opencv opencv3.0 orb