- Keypoints and compute descriptors in the loaded image, image, with ORB are as follows:
orb = cv2.ORB()
keypoints = orb.detect(image, None)
keypoints, descriptors = orb.compute(image, keypoints)
- Previously detected keypoints, keypoints, are as follows:
image_keypoints = cv2.drawKeypoints(image, keypoints, None, color=(255, 0, 255), flags=0)
To draw detected keypoints, the cv2.drawKeypoints() function is used.
- The BFMatcher object and matching of the descriptors, descriptors_1 and descriptors_2, which have been previously calculated, is created as follows:
bf_matcher = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
bf_matches = bf_matcher.match(descriptors_1, descriptors_2)
- The first 20 matches of the matches that were sorted before is as follows:
bf_matches = sorted(bf_matches, key=lambda x: x.distance)
result = cv2.drawMatches(image_query, keypoints_1, image_scene...