Project 4: Image Warping and Mosaicing

In this project, we use our knowledge of homographies to warp a bunch of images together and combine them into a large mosaic.

Shoot the Pictures

For my project, I'm using three sets of images that were all taken by me or other people. The first set was taken by a friend at Half Dome when she was hiking in Yosemite (captured from a video). The next two are pictures of my living room and street.

Recover Homographies

To recover the homographies, we follow the technique used in lecture to recover the eight free variables using homogeneous coordinates. The actual math break down looks something like the following, but done for every single pair of correspondences created (which are obtained using code from project 3 actually).

alt-text
A breakdown of how I computed the homography transformation.

Warp the Images

Next we simply warp the images using the homographies we recovered. This was quite tricky to get right as there were coordinates that needed to be adjusted for (i.e. negative ones and resizing the image). To test that our homographies worked, here are two examples of rectified images.

alt-text
My original photo. I picked one of the squares on the ground as a baseline.
alt-text
An example of my rectification, which didn't go well.

Blend Images into a mosaic

Finally, we can blend the images together by using our homography function to warp the images onto each other, then use an alpha blending function to blend the images together. I hand picked the alpha blending across the entire height of the image to make the mosaic look nice. Here are the originals and the resulting mosaics.

Half Dome

alt-text
Original Pictures of Half Dome, Picture 1.
alt-text
Original Pictures of Half Dome, Picture 2.
alt-text
Mosaic of Half Dome.

My Living Room

alt-text
Original Pictures of Living Room, Picture 1.
alt-text
Original Pictures of Living Room, Picture 2.
alt-text
Mosaic of Living Room.

Benvenue Ave

alt-text
Original Pictures of Benvenue Ave, Picture 1.
alt-text
Original Pictures of Benvenue Ave, Picture 2.
alt-text
Mosaic of Benvenue Ave.