Project 6A: IMAGE WARPING AND MOSAICING

Mian Zhong cs194-26-acm

In the first part of this project, I captured some photos to stitch, defined correspondences, computed Homography matrix and warped images! The homography matrix calculation is very similar to what we have done for affine matrix in previous project. The most challenging part for me was warping function implementation. With proper understanding, I finally debugged all flipped coordinates issue about my warping function after two long nights!

Part 1: Compute Homography

The homography transformation is defined as p' = Hp, where H is a 3x3 matrix with 8 degrees of freedom (set H_33 = 1). To recover the matrix, we rely on two sets P, P' of correspondence points from two images. The set needs to have at least 4 pairs to proper recovery. For every (x,y) in P, and (x', y') in P', we have (wx', wy', w) = H*(x, y, 1). Therefore, we can set up 2n x 8 matrix A, and h = [a b c d e f g h].T where n is the number of correspondence pairs, and a-h are 8 variables in H we try to recover. Ah=b such that b is all unrolled coordinates from P'.

Part 2: Image Rectification

Here is a tapa bar menu I took in Barcelona, and rectified menu:

Here is a whiteboard lecture note on the left, and rectified notes on the right:

Part 3: Mosaicing

Special thanks to my caring friends who hosted me almost every weekend to stay loved, supported and cozy. Here is my first try of shooting out study/dining place using a phone camera:

I use the center one as objective projection, then I got the left and right warped images:

The final mosaicing with and without cropping:

I captured three pictures using a DSLR camera at a rooftop. To speed up, I resized the image by 0.25, and again warped the first(L) and the third(R) image to the center:

The final mosaicing with and without cropping: