- we need at least 3 point pairs (matches) to calculate an affine transformation
- we need at least 4 point pairs (matches) to calculate a perspective transformation
we can use RANSAC to calculate the homography matrix between matches.
we used surf to detect matches, then we pass these matches to apply_ransac function.
- detecting matches by surf:
- getting the homography matrix from apply_ransac function and transform image 1.jpg to 2.jpg:
pip install numpy
pip install opencv-python (v3.4)
pip install matplotlib