Project 5: Stitching and Mosaics

PART A

Part 1: Image Warping and Mosaicing

Took three pictures of my living room to try to turn into a mosaic!

1.1: Recover Homographies

In [6]:
 

Using the above formula and least squares, I was able to get the values for a through h to use as values for H in the next part

1.2: Image Warp and Rectification

Using the equation p' = Hp I solved for p by applying the inverse homography matrix on the set of all coordinates, then normalizing all the x,y coordinates to 1 by dividing by w to get the rectified images.

Left, center and right image respectively!

In [7]:
 

Rectified Images:

In [9]:
 

1.3: Image Stitching

For this part, I took the three images and stitched them together to produce a mosaic. For some reason, the mosaic looks disoriented because I messed up one of the functions.

In [10]:
 

PART B

Detecting corner features in an image

I found the corner features using harris corners for the two city images provided by Shivam!

In [6]:
 
Out[6]:
<matplotlib.image.AxesImage at 0x11218ae10>
In [7]:
 

Feature Descriptor and matching them between two images

In [8]:
 
In [9]:
 

Using ANMS I was able to get these:

In [10]:
 
In [11]:
 

RANSAC

Here's the homography I found after using RANSAC

In [15]:
 
Out[15]:
[[1.1429901, 0.07272355, -32.5205028],
 [0.01241088, 1.1964729, -296.232714],
 [-5.02792815e-06, 0.000391, 1.0]]

Conclusion

I had a great time working on this project and it was pretty cool to see how mosaics are created