There is more
For feature-based similarity comparison between two images, you could use the proportion (percentage) of matches as the ranking criterion too (for example, have the percentage of a match in the keypoints as key in the matched_images dictionary). Also, for scalability and reusability, you should serialize the descriptors for all of the search images you have in your search directory (for example, use pickle) and load/deserialize all of the descriptors when you want to match with a query image descriptor—it is also left for you as an exercise. You can use SURF, KAZE, or any other feature for matching and any distance/similarity metric between the descriptors. For production, use an algorithm for fast computation of the similarities ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access