OpenCV ORB 检测器发现的关键点很少

OpenCV ORB detector finds very few keypoints(OpenCV ORB 检测器发现的关键点很少)
本文介绍了OpenCV ORB 检测器发现的关键点很少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试使用 ORB 关键点检测器,它返回的点似乎比 SIFT 检测器和 FAST 检测器少得多.

I'm trying to use the ORB keypoint detector and it seems to be returning much fewer points than the SIFT detector and the FAST detector.

此图显示了 ORB 检测器发现的关键点:

This image shows the keypoints found by the ORB detector:

这张图显示了 SIFT 检测阶段发现的关键点(FAST 返回的点数相似).

and this image shows the keypoints found by the SIFT detection stage (FAST returns a similar number of points).

只有这么少的点会导致跨图像的特征匹配结果非常差.我现在只是对 ORB 的检测阶段感到好奇,因为这似乎我得到了不正确的结果.我已经尝试使用 ORB 检测器和默认参数以及下面详述的自定义参数.

Having such few points is resulting in very poor feature matching results across images. I'm just curious about the detection stage of ORB right now though because this seems like I'm getting incorrect results. I've tried using the ORB detector with default parameters and also custom parameters detailed below as well.

为什么会有这么大的差异?

Why such a big difference?

代码:

orb = cv2.ORB_create(edgeThreshold=15, patchSize=31, nlevels=8, fastThreshold=20, scaleFactor=1.2, WTA_K=2,scoreType=cv2.ORB_HARRIS_SCORE, firstLevel=0, nfeatures=500)
#orb = cv2.ORB_create()
kp2 = orb.detect(img2)
img2_kp = cv2.drawKeypoints(img2, kp2, None, color=(0,255,0), 
        flags=cv2.DrawMatchesFlags_DEFAULT)

plt.figure()
plt.imshow(img2_kp)
plt.show()

推荐答案

增加 nfeatures 会增加检测到的角点的数量.关键点提取器的类型似乎无关紧要.我不确定如何将此参数传递给 FAST 或 Harris,但它似乎可以工作.

Increasing nfeatures increases the number of detected corners. The type of keypoint extractor seems irrelevant. I'm not sure how this parameter is passed to FAST or Harris but it seems to work.

orb = cv2.ORB_create(scoreType=cv2.ORB_FAST_SCORE)

orb = cv2.ORB_create(nfeatures=100000, scoreType=cv2.ORB_FAST_SCORE)

这篇关于OpenCV ORB 检测器发现的关键点很少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)