Detecting scale invariant keypoints
Objects in the real world are moving, making it harder to accurately compare them with their previous appearances. When they approach the camera, the objects get bigger. To deal with this situation, we should be able to detect keypoints that are insensitive to an object's size differences. Scale Invariant Feature Transform (SIFT) descriptors have been designed especially to handle different object scales and find the same features for the objects, no matter what their size is. This recipe shows you how to use SIFT implementation from OpenCV.
Getting ready
Before you proceed with this recipe, you need to install the OpenCV version 3.0 (or greater) Python API package with contrib modules.
How to do it...
You need to complete the following steps:
- Import the necessary modules and load images:
import cv2 import numpy as np img0 = cv2.imread('../data/Lena.png', cv2.IMREAD_COLOR) img1 = cv2.imread('../data/Lena_rotated.png', cv2.IMREAD_COLOR) img1 = cv2.resize(img1...