CS 194-26:Image Manipulation, Computer Vision and Computational Photography

Project 5A : IMAGE WARPING and MOSAICING

Xuanbai Chen,cs194-26-ags

Overview

In the first part of projest 5,we will make some mosaic images and rectify imgages,so that the perspective field is larger. I will warp two or more images into the same angle and blend them together.


Part 1: Shoot and digitize pictures

I find pictures from the webite from different angle of the same building (the British Museum), and also took some photos from my cell phone since the cell phone does not expert in taking photos, the resolution is a little bit low. I will show some of the images I use below:


Part 2: Recover homographies

Just like the face morphing in project 3, we also need a 3*3 matrix to 'translate' from one image to the other. There are 8 parameters that we need to know so we should pick at least 4 points to solve the equation sets. But in order to get a more stable results,the more correspondent points, the better. And then we use least-squares to get the best results. The math formulation is as below:

A should be parameter matrix and b should be value matrix. And we will generate the parameter which minimize the equation above.


Part 3: Warp the images and Rectification

In order to get a better performance, I use inverse warp to rectify the images. Unlike the warp of project3. This time if we want to 'translate' image1 to image2, we need to acquire all the image1 to another image. And in order to get every points pair. I use a larger array from negative 1 times the size of image to positive 2 times the size of image. If the point multiply the matrix H is negative, just delete it. Since there are still some negative points, I also use a large mask(black) to get the 'translated' image (add the abs of minimize value of every value to get positive value) and then crop it to get the final result.

Original Image : Reference Image

Result

Result


Part 4: Blend images into a mosaic

In this part,we can just use Laplacian pyramid what we implement in project2. The only difference is that we need to know the size of mask and find the same content of different images to make them aligned.

Three examples of mosaic images:


Part 5: What I have learned

I learned a ton in the first part of project 5. The most important part is the warp part. I got more familar with the warp function. It was just like the combination of project2 (blend using a laplacian pyramid) and project 3(how to warp one image to another image. It is like a overview of the former project and I really get funin this project.