Image Stitching using OpenCV and Python (Creating Panorama Project)

13 / 23

Visualizing Key-Points on the Images

Let us view the original image and the one with key-points marked to see what key-points were extracted.

Note:

  • cv2.drawKeypoint(input_image, input_image_key_points, output_image, color) method of OpenCV returns the output_image drawn with its key-points in given color, given the input_image and its key-points input_image_key_points, color as input arguments.
INSTRUCTIONS
  • Get the img_right_kp, the resultant of plotting img_right with its key-points kp1 drawn using cv2.drawKeypoints.

    img_right_kp = cv2.<< your code comes here >>(img_right, kp1, np.array([]), color=(0,0, 255))
    

    Observe, we pass np.array([]) in place of output image. The np.array([]) will be the output image with key-points drawn. If you want to draw the key-points to be drawn on the same input image, you could replace it with that image. In order to maintain modularity, let's pass a new empty NumPy array.

  • Get the img_left_kp, the resultant of plotting img_left with its key-points kp2 drawn in cv2.drawKeypoints.

    img_left_kp = cv2.<< your code comes here >>(img_left, kp2, np.array([]), color=(0,0, 255))
    
  • Visualize the img_left_kp and img_right_kp side-by-side.

    plt.figure(figsize=(30,20))
    plt.subplot(1,2,1)
    plt.imshow(fixColor(img_left_kp ))
    
    plt.subplot(1,2,2)
    plt.imshow(fixColor(img_right_kp ))
    plt.tight_layout()
    
Get Hint See Answer


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...