我目前正在使用各种功能提取器和各种匹配器进行识别程序.使用匹配器的分数,我想创建一个分数阈值,可以进一步确定它是正确匹配还是不正确匹配.
我试图理解来自各种匹配器的DMatch距离意义,距离值越小越好匹配吗?如果是,我很困惑,因为具有差异位置的相同图像返回比两个不同图像更大的值.
我运行了两个测试用例:
-----------------------------------------------
Positive image average distance
Total test number: 70
Comparing with SIFT
Use BF with Ratio Test: 874.071456255
Use FLANN : 516.737270464
Comparing with SURF
Use BF with Ratio Test: 2.92960552163
Use FLANN : 1.47225751158
Comparing with ORB
Use BF : 12222.1428571
Use BF with Ratio Test: 271.638643755
Comparing with BRISK
Use BF : 31928.4285714
Use BF with Ratio Test: 1537.63658578
Maximum positive image distance
Comparing with SIFT
Use BF with Ratio Test: 2717.88008881 …Run Code Online (Sandbox Code Playgroud) 我目前正在尝试使用FLANN实现ORB,我已经阅读了文档并且它说当使用ORB和FLANN时我必须使用:
index_params= dict(algorithm = FLANN_INDEX_LSH,
table_number = 6, # 12
key_size = 12, # 20
multi_probe_level = 1) #2
Run Code Online (Sandbox Code Playgroud)
我的代码
def useFLANN(img1, img2, kp1, kp2, des1, des2, setDraw, type):
# Fast Library for Approximate Nearest Neighbors
MIN_MATCH_COUNT = 10
FLANN_INDEX_KDTREE = 0
if type == True:
# Detect with ORB
index_params= dict(algorithm = FLANN_INDEX_LSH,
table_number = 6, # 12
key_size = 12, # 20
multi_probe_level = 1) #2
else:
# Detect with Others such as SURF, SIFT
index_params = dict(algorithm …Run Code Online (Sandbox Code Playgroud)