You need to complete the following steps:
- Import the necessary modules and load images:
import cv2import numpy as npimg0 = cv2.imread('../data/Lena.png', cv2.IMREAD_COLOR)img1 = cv2.imread('../data/Lena_rotated.png', cv2.IMREAD_COLOR)img1 = cv2.resize(img1, None, fx=0.75, fy=0.75)img1 = np.pad(img1, ((64,)*2, (64,)*2, (0,)*2), 'constant', constant_values=0)imgs_list = [img0, img1]
- Create a SIFT keypoints detector:
detector = cv2.xfeatures2d.SIFT_create(50)
- Detect the keypoints in each image, visualize the keypoints and display the result:
for i in range(len(imgs_list)): keypoints, descriptors = detector.detectAndCompute(imgs_list[i], None) imgs_list[i] = cv2.drawKeypoints(imgs_list[i], keypoints, None, (0, 255, 0), ...