CS 194-26 Project 6a (Image Warping and Mosaicing) - Michelle Chen

Overview

For this project, we utilize projective warping to composite multiple images from different perspectives into image mosaics.

Part 1 - Recovering Homographies

In the first part we get the parameters of the transformation matrix between the images we sampled. The transformation matrix is the homography matrix p’=Hp, where H is a 3x3 matrix. There are actually on 8 degrees of freedom, so h33 is actually just set to 1. We compute H by first solving the below matrix equation. We use least squares since using simple inverse matrix multiplication would fail if we had more than 4 sample points. After getting the values of the h vector, we reshaped it to the square 3x3 matrix.

Part 2 - Image Rectification

After retrieving the homography, we do some test warps and warp some images so that it appears that we have a frontal perspective of it. To do so, we use forward warping with the homography matrix on the pixels of the original image to the correct position in the new image.

Before
After

Before
After

Before
After


Part 3 - Image Mosaic

To create the image mosaic, I took two pictures of the same image in different perspectives with some overlap. Then I warped one of the images into the perspective of the other image using the previous steps, and blended them together using linear blending with a gradient mask. Because some of the data from the images get lost after warping, I padded both images to be twice the original size before doing the warp and blending. The images are a little blurry and have some artifacts, but I believe that it was mostly because I moved my hands between images or subjects in the image moved a bit.

Source image 1
Source image 2
Image mosaic
Source image 1
Source image 2
Image mosaic
Source image 1
Source image 2
Image mosaic

Summary

Overall I learned that you can do pretty cool things with matrix transformations, and I thought it was cool that we could replicate certain camera functionalities just by using some linear algebra.