Wie man die pixel-Koordinaten von Feature-Matching in Python-OpenCV

Ich brauche, um die Liste der x und y Koordinaten der Pixel, die die Funktion matcher wählt im code zur Verfügung gestellt. Ich bin mit Python und OpenCV. Kann mir jemand helfen?

img1=cv2.imread('DSC_0216.jpg',0)
img2=cv2.imread('DSC_0217.jpg',0)

orb=cv2.ORB(nfeatures=100000)
kp1,des1=orb.detectAndCompute(img1,None)
kp2,des2=orb.detectAndCompute(img2,None)

img1kp=cv2.drawKeypoints(img1,kp1,color=(0,255,0),flags=0)
img2kp=cv2.drawKeypoints(img2,kp2,color=(0,255,0),flags=0)
cv2.imwrite('m_img1.jpg',img1kp)
cv2.imwrite('m_img2.jpg',img2kp)

bf=cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
matches=bf.match(des1,des2)
matches=sorted(matches, key= lambda x:x.distance)
InformationsquelleAutor kotopanda | 2015-06-08
Schreibe einen Kommentar