小编Arw*_*ego的帖子

OpenCV使用匹配分数查找正确的阈值以确定是否匹配图像

我目前正在使用各种功能提取器和各种匹配器进行识别程序.使用匹配器的分数,我想创建一个分数阈值,可以进一步确定它是正确匹配还是不正确匹配.

我试图理解来自各种匹配器的DMatch距离意义,距离值越小越好匹配吗?如果是,我很困惑,因为具有差异位置的相同图像返回比两个不同图像更大的值.

我运行了两个测试用例:

  1. 将一个图像与具有不同位置的相同图像进行比较等.
  2. 将一个图像与具有几个不同位置的完全不同的图像进行比较等.

这是我的测试结果:

-----------------------------------------------

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)

python opencv matcher feature-extraction threshold

8
推荐指数
1
解决办法
1489
查看次数

OpenCV 3.2 NameError:未定义全局名称"FLANN_INDEX_LSH"

我目前正在尝试使用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)

opencv python-2.7 orb flann

4
推荐指数
1
解决办法
2723
查看次数