This is a software utility for feature matching using affine and homography transformations. The software can be used in cohesion with feature detectors (i.e. SIFT and FLANN) to compute the transformations. To mitigate the effect of outliers, I also provide an implementation of RANSAC.
Numpy
Matplotlib
The script provides two transformations: Affine transformation (a linear transformation that preserves the parallelism of lines) and Homography transformation (a projective transformation).
Since the Affine matrix has 6 DoFs, you need a minimum of 3 corresponding pairs to solve the problem.
For Homography matrix there are 8 DoFs, so you need a minimum of 4 corresponding pairs.
I have also provided a function for shifting the coordinates to a centroid system, as in the case of large coordinate values, the matrices can become instable during inversion.
This script provides an implementation of RANSAC for computing the transformations using a selected number of inlier points. The Euclidean distance metric is used to determine the 'outlingness' of the points. You have to provide the minimum number of inliers you want to detect and a threshold for classifying a point pair as an inlier.
Free-to-use (MIT), but at your own risk.