CS 194-26 Project 6

Image Warping and Mosaic

Kate Shijie Xu cs194-26-abf

In this part of the project, I implemented manual image mosaicing. To create an image mosaic or a panorama, I first find correspondences between sets of pictures, recover a homography matrix using the correspondences, and then apply the homography transformation to warp points.

Overall Process

1. Define Correspondences

To start the project, I took pictures of random things with my IPhone. I then defined correspondences between the images with ginpoint in python.

2. Recover Homography

Before I can align the pairs of images, I need to recover the homography transformation matrix H. As seen in the equation below, H is a 3x3 matrix. If we set scale factor i to 1, then we have 8 unknown variables to solve. Thus, we need a minimum of 4 pairs of corresponding points to either directly solve for H or estimate H using least squares.

Homography Transformation before a pair of corresponding points (p, p').

3. Image Warping

After recovering the homography matrix, I then use inverse warp to creat the transformed image: I first applied the homography transformation on the corner points of the original image to find the border offsets, then created a blank output image with appropriate padding, before finding the inverse warped pixel for every point in the output image.

Image Rectifying

To test my homography recovering and image warping process, I rectified a few simple images so that square shapes in the images are frontal-parallel.

Box
Square Box
Okonomiyaki Sign
Square Okonomiyaki Sign
Pool
Square Pool

Image Mosaicing

1. Apartment Building
Trees
Apt 1
Trees
Apt 2
Trees
Apt 1 Points
Trees
Apt 2 Points
Trees
Full Apartment
2. Apartment Building
Trees
Lake Left
Trees
Lake Right
Trees
Full Lake
3. Toy Collection
Trees
Toy Left
Trees
Toy Right
Trees
All Toys

It's really cool that I'm able to create my own panoramas in this project! The image warping process was more challenging than I had expected because of padding issues, but I'm glad to finally get it to work as desired.