Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- orb = cv2.ORB_create()
- kp1, des1 = orb.detectAndCompute(l, None)
- kp2, des2 = orb.detectAndCompute(r, None)
- # create BFMatcher object
- bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
- # Match descriptors.
- matches = bf.match(des1, des2)
- # Sort them in the order of their distance.
- matches = sorted(matches, key=lambda x: x.distance)
- # Graph the difference in x and y to see if we can identify a trend.
- x_coords = []
- y_coords = []
- for match in matches[:50]:
- x_coords.append(kp2[match.trainIdx].pt[0] - kp1[match.queryIdx].pt[0])
- y_coords.append(kp2[match.trainIdx].pt[1] - kp1[match.queryIdx].pt[1])
- plt.scatter(x_coords, y_coords)
- plt.show()
Add Comment
Please, Sign In to add comment