Skip to content

This is a software utility for feature matching using affine and homography transformations

Notifications You must be signed in to change notification settings

fazanham/FeatureMatching

Repository files navigation

PythonFeatureMatching

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.

Dependencies

Numpy
Matplotlib

Transformations

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.

RANSAC

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.

Example

Affine:
house_affine

Affine + RANSAC: house_affine_ransac

Homography:
homography_library

Homography + RANSAC: homography_ransac

License

Free-to-use (MIT), but at your own risk.

Releases

No releases published

Packages

No packages published

Languages