ORB功能匹配和汉明距离“退化”

时间:2018-11-21 17:07:27

标签: opencv orb

我正在尝试在两个大图像(正像照片以5 cm分辨率覆盖数百英亩)中找到匹配的特征,以便我进行注册。我在两张图片中找到了成千上万个关键点,然后找到了经过交叉检查的匹配项,对它们进行了排序,并取得了最好的〜30%匹配项。从地理上看,比赛不是很好。这是代码:

def find_matches(key1, dsc1, key2, dsc2):

#Match features - this uses the BFmatcher class, I use it to take advantage of crossCheck
matcher = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
matches = matcher.match(dsc1, dsc2)


# Sort matches by score
matches.sort(key=lambda x:x.distance, reverse=False)

# Remove not so good matches Is this needed when we do geo sort?
print("cross-check matches = ", len(matches))
numGoodMatches = int(len(matches) * GOOD_MATCH_PERCENT)
matches = matches[:numGoodMatches]

# Draw top matches
imMatches = cv2.drawMatches(refimgGray, key1, imgGray, key2, matches, None, flags=4,)
cv2.imwrite(r"C:\AV GIS\matches.jpg", imMatches)

return matches

当我查看与已排序的匹配项相关的距离图时,会看到许多汉明距离值相同: Graph of match distances - x-axis is sorted match number, y-axis is Hamming distance. It looks like stair steps, with many matches sharing the same Hamming distance.

我正在添加更多匹配项过滤条件,以确保它们在地理位置上接近,但是我认为我放弃了许多好的匹配项,只是因为它们对匹配器“不可见”。

这是我的问题: 谁能解释只有一个要评估的分数而不是唯一的时如何决定比赛?我用单个摄像机图像(像素数量级要小几个数量级)尝试了同样的事情,即使如此,距离得分也不是唯一的。我是否误解了如何找到和使用这些匹配项?

已添加-这是按地理距离着色的最佳关键点匹配图。 graph of best keypoint matches colored by geographic distances

0 个答案:

没有答案
相关问题