Finding similarity between an image and a set of images with SIFT

You will use SIFT keypoints/descriptors to compute the similarity between two images (using opencv-python). Here are the steps that you will need to follow:

  1. First, read the query image. Also, read all of the images from the search directory to find the best possible matches:
query = cv2.imread("images/query.jpg")                                                                  matched_images = defaultdict(list)                                                                  for image_file in glob.glob('images/search/*.jpg'):                                                   search_image = cv2.imread(image_file)                                                       

The query image is shown here:

  1. Extract the SIFT keypoints and descriptors for the query image and all of the search images using the following ...

Get Python Image Processing Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.