問題描述
我正在嘗試使用 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 檢測器發現的關鍵點很少的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!