Project 5 Part I - Image Warping and Mosaicing

by Ashna Choudhury

Overview

In the first half of project 5, we worked again with image warping to create image mosaics and panoramas.

Part 1: Shooting the Images

Due to the current situation involving COVID-19, it was difficult and ill-advised to go outside for the sake of photographing our images even though this would have been fun to do in an ideal situation. Instead, I chose to photograph simple objects and scenes in my house.

Below are two sets of images I worked with:

Image 1 Correspondence Points
Image 2 Correspondence Points
Image 1 Correspondence Points
Image 2 Correspondence Points

The goal later on in this section will be to warp our first image to better match the perspective of the second image.

Part 2: Recovering the Homography Matrix"

In part 2, we needed to implement an algorithm that could successfully recover the Homography Matrix , or the matrix that will inform us how to warp our image. The basic method to calculate the Homography matrix is summarized by the following equation...

p' = H * p

...where p' represents a correspondence point in our second image, and p represents a correspondence point in our first image. For our two sets of images above, the approximate correspondence points are marked in red and blue respectively.

With our points selected, we can use a Least Squares Algorithm to calculate our matrix H.

Part 3: Warping the Images (Rectification)"

With our homography matrix successfully calculated, we can proceed to warp the image. Similar to what we did in project 3, we will use Inverse Warping to successfully rectify or "straighten" the perspective of our warped image to match the second input image we used earlier.

The result of Image Rectification can been seen in the warped images below:

Rectified Donuts
Rectified Hallway

Observations

From working on this section, I found that successfully warping an object requires close attention to the order of indexing and placing the pixels of the warped image. I spent many many hours trying to debug problems in my code, when really it all came down to my ordering being off. How you photgraph your images also plays a factor in the final result: I intially attempted to use two other photographs of my kitchen however the warped wasn't working quite well as the two images did not have a clear rectangular surface to focus on. It was then that I decided to take the other pictures which proved much better in the final results.