Complete the code to extract keypoints using ORB detector.
import cv2 img = cv2.imread('image.jpg', 0) orb = cv2.ORB_create() keypoints = orb.[1](img)
The detect method finds keypoints in the image, which are distinctive points.
Complete the code to compute descriptors for the detected keypoints.
keypoints, descriptors = orb.[1](img, keypoints)The detectAndCompute method detects keypoints and computes descriptors in one step.
Fix the error in the code to correctly match descriptors using BFMatcher.
bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True) matches = bf.[1](des1, des2)
The match method finds the best matches between two sets of descriptors.
Fill both blanks to create a dictionary of keypoints and their coordinates.
kp_dict = {kp.[1]: (kp.[2][0], kp.[2][1]) for kp in keypoints}The pt attribute of a keypoint gives its (x, y) coordinates.
Fill all three blanks to filter good matches based on distance.
good_matches = [m for m in matches if m.[1] < [2] * min_dist and m.[3] != 0]
We filter matches where the distance is less than 0.7 times the minimum distance, and the queryIdx is not zero to avoid invalid matches.