Home

Awesome

ImageCoregistration

A simple Image regestring method based on SIFT descriptors and RANSAC algorithm for filtering out the outliers.

Requirements

Setup

git clone https://github.com/ily-R/ImageCoregistration.git
cd ImageCoregistration

Usage

Very easy to use. Put the images you want to register, the target and the source(say "img1.jpg" and "img2.jpg") in data\ folder and run the follwing.

python image_register.py img1.jpg img2.jpg --sift

Arguments

This is the full set of system arguments supported.

python image_register.py img1.jpg img2.jpg -s 0.5 --sift -r

Notes

Testing

Original images:

We can see that there a slight translation upward with probably small rotation to the left.

<p align="center"> <img src="https://github.com/ily-R/ImageCoregistration/blob/master/readmeImages/original.gif?raw=true" alt="capture reconstruction"/> </p>

Floating the source image:

Applying the registation on the source image, we see how it floats from its original position to another upward. This is done to assure that most pixels are alligned to the target ones.

<p align="center"> <img src="https://github.com/ily-R/ImageCoregistration/blob/master/readmeImages/source_moving.gif?raw=true" alt="capture reconstruction"/> </p>

Result:

Floating the source image we see how perfectly are the images aligned. To not get distracted by the upper border moving, put the tip of the mouse on any position and verify that the mouse tip stands steel. If you do this in the above gif, the tip will change positions.

<p align="center"> <img src="https://github.com/ily-R/ImageCoregistration/blob/master/readmeImages/solution.gif?raw=true" alt="capture reconstruction"/> </p>

Features:

The tested image showed a perfect match of features as see below. (showing only 20 out of around 200)

<p align="center"> <img src="https://github.com/ily-R/ImageCoregistration/blob/master/readmeImages/matches.jpg?raw=true" alt="capture reconstruction"/> </p>

This is due to the use of sift_error =0.7 which filter out outliers. Read the doc of match(lmk1, lmk2, desc1, desc2, sift_error=0.7) for more details. Using RANSAC on top of this result will not change the landmarks selection. To force outliers, we let sift_error =0.9. Now after using RANSAC, here's the outliers filtered.

<p align="center"> <img src="https://github.com/ily-R/ImageCoregistration/blob/master/readmeImages/matches_removed_by_RANSAC.jpg?raw=true" alt="capture reconstruction"/> </p> We see that the landmarks are similar locally, but globally they refer to different 3D points.

Metrics

Two metrics are used plus the reconstruction error:

<p align="center"> <img src="https://github.com/ily-R/ImageCoregistration/blob/master/readmeImages/joint_histogram.jpg?raw=true" alt="capture reconstruction"/> </p>

More Testing

Here are some screen shot taken from Google maps satellite above the Eiffel tower

<img width = 400 align="left" src="https://github.com/ily-R/ImageCoregistration/blob/master/data/s1.jpg?raw=true" alt="capture reconstruction"> <p align="right"> <img width = 400 src="https://github.com/ily-R/ImageCoregistration/blob/master/data/s2.jpg?raw=true" alt="capture reconstruction"/> </p>

We confirm also what we said about the joint-histogram in this case, as seen below.

<p align="center"> <img src="https://github.com/ily-R/ImageCoregistration/blob/master/readmeImages/joint_histogram_paris.jpg?raw=true" alt="capture reconstruction"/> </p>

Applying the registration to float the source to the target image we get the following:

<p align="center"> <img src="https://github.com/ily-R/ImageCoregistration/blob/master/readmeImages/paris.gif?raw=true" alt="capture reconstruction"/> </p>

You can see how the Eiffel tower is moving, which indicates the two images present in the gif come from different perspectives. Which in our case the source and target images.

Future work: