Part 1: Image Warping and Mosaicing

The overall goal of this project is to warp images and use the warping to create panoramas. For this first part, we select correspondances between two images, and we can use homography to transform an image so that its keypoints match the keypoints in the second image. The transformation is of the form p' = Hp, where H is a 3x3 matrix with the lower right value fixed as 1.

Shooting the Pictures

Here are several of the pictures that I've taken for the purposes of this project.

Recover the Homographies

Suppose we are trying to map points (x, y) to (x', y'). Then we want to solve the equations:
ax + by + c - gxx' - hyx' = x'
dx + ey + f - gxy' - hyy' = y'
With more equations for the rest of the selected keypoints. a, b, c, d, e, f, g, h are variables that are part of the homography matrix, with the lower right corner set to 1.

Image Rectification

Using this method, I rectified several images so that one surface becomes frontal-parallel. Here are several examples below. In the first row, the window was made frontal-parallel, while in the second row, the windows and lights became frontal-parallel.

Original Rectified

Blend the images into a mosaic

By "rectifying" one image so the keypoints from one image match the keypoints in another image, and then aligning the images, I was able to "blend" the image into a mosaic.

Original 1 Original 2 Blended