【发布时间】:2021-02-26 02:27:20
【问题描述】:
img1=cv2.imread('/content/datamy/notre.jpg',0)
img2=cv2.imread('/content/datamy/notre2.jpg',0)
surf = cv2.xfeatures2d.SURF_create(500)
kp1, des1 = surf.detectAndCompute(img1,None)
kp2, des2 = surf.detectAndCompute(img2,None)
bf = cv2.BFMatcher()
matches = bf.knnMatch(des1,des2, k=2)
good = []
for m,n in matches:
if m.distance < 0.5*n.distance:
good.append([m])
img3 = cv2.drawMatchesKnn(img1,kp1,img2,kp2,good,None,flags=2)
plt.imshow(img3),plt.show()
我看不到匹配的行,因为它太小了。有没有办法打印更大的尺寸?(就像原来的尺寸一样。)
【问题讨论】:
标签: python opencv computer-vision feature-detection google-colaboratory