Image Warping and Mosaicing

Aditya Yadav


Part 1:

Part 1 of this project had to do with manually stitching images together by selecting corresponding points between them, computing the homography, warping and blending them together. An aspect of that is also rectification which is shown as well.

Example 1

These are the two images I used for this first example to showcase image stitching and rectification:


This is what it looks like after I took image 1 (the left image) and rectified it by taking a window pane and matching it to square coordinates:


This is what it looks like after manually picking 8 corresponding points between the two images and warping image 1 accordingly to image 2's geometry:


And finally this is their combined mosaic with some alpha blending:


Example 2

These are the two images I used for this second example to showcase image stitching and rectification:


This is what it looks like after I took image 1 (the left image) and rectified it by taking the calendar in the top left and matching it to square coordinates:

In this example I set a bounding region so the calendar is the only aspect of the image shown

This is what it looks like after manually picking 8 corresponding points between the two images and warping image 1 accordingly to image 2's geometry:


And finally this is their combined mosaic with some alpha blending:



Fun Rectification Example

I decided to try making the mural in this image into a square in order to see it a bit more head on:


This is the result after rectification:



Part 2:

Part 2 of this project had to do with autostitching. In order to do so we do the following: interest point detection, feature extraction, feature matching, RANSAC, stitch. Manually selecting points by hand is not good enough. As we will see here, we get much better results.

Example 1

These are the two images I used for this first example:


The first step was to find the harris corners in the images

These are 500 of the max harris corners detected in the two images respectively:

These are the 500 harris corners chosen after using adaptive non maximal surpression based on the paper:

Evidently, the 500 corners after using ANMS are much better and spread out so we use those going forward.


The next step was to extract features around these chosen harris corners from both images. To do so, we first extracted 40x40 patches around the interest points and then sampled them down to 8x8.

These features were then saved as 64 length vectors


Using those features, we computed the first and second nearest neighbors for each feature from image 1 to those in image 2 based on their SSD.

We computed the SSD(1-NN) / SSD(2-NN) for each feature and thresholded that value.

This is a technique by Lowe. We kept features where the value of that was < 0.5 thus ensuring the first nearest neighbor was significantly better than the second.


Finally we used RANSAC to eliminate further bad matches. I ran 10000 iterations and thresholded the distance by 0.5

This is the result after using those remaining pairs of points to compute the H matix and perform the warping and blending:

This is the result after doing this manually, as you can see it is much worse:


The same techinques as shown above were used for the following 2 examples as well. I will show the harris corner images and the results / comparison to manually doing so for them as well:

Example 2

These are the two images I used:










These are 500 of the max harris corners detected in the two images respectively:

These are the 500 harris corners chosen after using adaptive non maximal surpression based on the paper:

This is the result after feature extraction/matching and thresholding and using RANSAC:

Compared to the manual stitching below, it's much better


Final Example (3)

These are the two images I used:


These are 500 of the max harris corners detected in the two images respectively:

These are the 500 harris corners chosen after using adaptive non maximal surpression based on the paper:

This is the result after feature extraction/matching and thresholding and using RANSAC:

This is the manual stitching: