CS 194-26 Image Manipulation and Computational Photography

Project 6: Stitching Photo Mosaics

Mher Mnatsakanyan (cs194-26-aac)

Part A

The goal of this part is to create an image mosaic by doing projective warping, resampling and composing the images together.

Image Rectification

In order to test that the homography and inverse warping work correctly, we will take a few sample images with planar surfaces and warp them to get a frontal-parallel plane. The first example is a picture of a Berkeley 150 poster. Here is the picture.

Berkeley 150 Poster

For the first set of points we have 4 corners of the poster and the mapping points are [0, 500], [0, 0], [500, 0], [500, 500]. Then we compute the homography matrix and perform the inverse warping on the image. We specify the output image size to be 500x500 that we would only get the poster on the image. Here is the result.

Rectifiied Berkeley 150 Poster

Another example is the seal near the Memorial Glade.

Cal Seal and the rectifiied image

Blend the images into a mosaic

For this part of the project we are going to stitch a few images into a mosaic. The idea is to define several corresponding points between the images. I used 3 images for this part and I had two sets of corresponding points for the first and second images, and the second and third images. The first set of points are for approximating the first homography matrix using the least squares. After calculating the homography we stitch the first two images together. Then we repeat the same logic and actions to stitch the third one on the already warped image. For combining the warped images, I used the element-wise maximum of the warp images, which gave better results than linear blending.

These are the 3 images from downtown berkeley Bart station.

Downtown Berkeley

The result after warping the first and last two images and stitching them together.

Downtown Berkeley Mosaic of 12 and 23

The final result looks like this.

Downtown Berkeley Mosaic

The black background behind the stitched image is because of padding. In order to get all the image pixels after warping I perform a padding before performing the inverse warping. Here is another images from the Memorial Glade.

The Memorial Glade

The final result.

Downtown Berkeley Mosaic