CS294 Project 5-PartA - Jing Yuan

CS194 - 26 Intro to Computer Vision and Computational Photography

Project 5A - Image Warping and Mosaicing

By Jing Yuan [Email: jingyuan10@berkeley.edu]


The goal of this assignment is to play with different aspects of image warping with a “cool” application -- image mosaicing. I will three set of photographs and create an image mosaic by registering, projective warping, resampling, and compositing them. Along the way, I learnt how to compute homographies, and how to use them to warp images.


Part 1: Shoot the Pictures

I went to the Great Fall Park, and I took three sets of photographs for this projects by simply rotating the tripod and use the Mannual Mode of camera (Canon cameras).

Set 1: Visitor center of the Great Fall park

Set 2: Trail to the Great Fall

Set 3: The front of the Great Fall

Part 2: Recover homographies

Before I can warp images into alignment, yI need to recover the parameters of the transformation between each pair of images. The transformation is a homography: p’=Hp, where H is a 3x3 matrix with 8 degrees of freedom. Due to the df, we actualy need 4 points for the parameters calculation, but in order to match two images perfectly, we usually choose more than 4 points. In this case, we solve the transformation with least square. And I used inverse warping for this project, so I use the inverse of the H to reconstruct the warped images.

Part 3: Image Rectification

To test out my computeH and warpImage function. I chose two example images as following. And I assume that the painting on the wall is rectangular and the shape on the floor is square. Then I apply the target points and selected points to functions and get the following results.

Sample1


Sample2



Part 4: Blend the images into a mosaic

To blend images into a mosaic, I took two photos with overlapping points. I kept one image still while I warped the second image to points selected from the first. Becasue there are three photos, I first blended image on the left and the image in the middle. Then, I used the blended midway image with the right image to create the final look. I padded the image with zeros or black pixels to allow extension of the image vertically and horizontally. I have results for fixed-alpha blending.


Results 1: Visitor center of the Great Fall park
Step 1: Combining left image with the middle image


Step 2: Combining midway image with the right image


Results 2: Trail to the Great Fall
Step 1: Combining left image with the middle image


Step 2: Combining midway image with the right image


Results 3: The front of the Great Fall
Step 1: Combining left image with the middle image


Step 2: Combining midway image with the right image

Learning

I love this project! It is tough to finish this project and I need to think of the how to do the alpha mask since I have no experience with the mask, but I really enjoy it. And I also find out that not only the number of the points selected in the photo is important, but also the distribution of the selected point is also important. We need to let the point distributed seperately in the picture, or non-selected area will create wired stuff.