Project 5: Image Warping and Mosaicing

Calvin Tang | calvintang@berkeley.edu | 3031974882

Part 1

The purpose of this part of the project is to understand homographies and transform images into mosaics. This employs a different method of image transformation we have not worked with before.

Recovering Homographies

A homography is a type of transformation with 8 degrees of freedom. We will be applying this transformation to our photos such that they may be manipulated for image rectification and, later, mosaics. Our first step in this process is finding the parameters of H, the homography matrix for the transformation. Below is a snapshot of the matrix equation of homography. This is taken from

this lecture from a course at Penn State.

The input to our function computeH takes in two parameters: correspondence points from a "before" image and correspondence points from an "after" image. We use these points in a system of equations to solve for the 8 parameters of the H matrix. Using the equation setup from above, we solve our system using least squares. This solution provides us with the inputs for the transformation matrix H.

Image Warping

After receiving our transformation matrix, we work on transforming the images in order to rectify them. I had a lot of trouble with this portion of the assignment because I felt that x and y values needed to be swapped and played around with to get successful results. My process for this part was to receive all of the pixels within an image and apply the transformation H to them via dot product. It was necessary to "normalize" the values received from the output of this dot product because each pixel coordinate was scaled by some w, which was also found by the dot product. After dividing both the x and y coordinate by this w value, we were able to receive the translated coordinate, thus successfully transforming the image to new shape to accommodate the rectangle.

Image Rectification

Below are some results of my image rectification. I was quite pleased with the results using standard rectangles, or in this case, paintings.

Bridge

Springtime

Curved Monitor

I included this set of images because I thought it was funny how the rectification came out. Since the monitor is not a perfect rectangle, the resulting warping image came out a bit funnier than the rest. It looks like you have to choose objects in photos with good rectangular shape to produce well-blended images.

In the next part of this project, I will be working on creating mosaics of my photos, both manually and automatically.