CS 194-26: Computational Photography, Fall 2017

Project 6A: Image Warping and Mosaicing

Tom Cheng, cs194-26-aev



Overview

In this project, we used projective transforms and linear algebra to create mosaics. To do this, we calculated the homography between the corresponding points given two images. We then use this homography to warp one of our photos and eventually blend our base image and warped photo into a mosaic.

Recover Homographies

The homography can be calculated using the formula Ah = b. The steps I took in building our A and b can be found in Figure 1, where (x, y) represents the first point and (x', y') represents its corresponding point. After I've created my matrix A and vector b, I use least squares to solve for my homography.

Figure 1

Image Rectification

We can rectify an image by first selecting 4 points of something in the image. Afterwards, we can use the homography calculated to warp the images such that the planes become frontal-parallel. In other words, we take the selected 4 points and warp them into a rectangle or square.

Example 1
Rectified!
Example 2
Rectified!

Mosaics

For mosaics, I first specified an image to be the "base". We will be warping the other image in such a way that it'll "overlap" with the base to continue the objects of interest and create a mosaic. For this part of the assignment, I stuck with two very rudimentary blending methods, namely naive and linear blending. I've briefly discussed the two blending methods below.

What Doe?

Images
Mosaic
Naive Blend
Linear Blend

East Asian Library - A Mosaic Inception

Images
Mosaic
Naive Blend
Linear Blend

Construction Mosaics

Images
Mosaic
Naive Blend
Linear Blend

What I Learned

This assignment was super cool in helping me realize the power of linear algebra. I didn't have a great linear algebra experience here at Berkeley, but cool applications like these are challenging that experience and turning it into something great. Another thing that I find absolutley fascinating is just how good our phones are in both taking and stitching these panorama photos. Our phones must have some highly optimized algorithms to do all that in such a small form-factor.

The End.

Thanks so much for reading!