Project 6a: Image Warping and Mosacing, First Part

Julie Soohoo (cs194-26-acb)

In the project, I use homographies to warp images and create mosaics.

Image Warping

By using a homography, we a project set of points onto a another. In order to warp the images we have, we must first solve for the homography matrix H, by setting up a system of equations using 2 sets of points which correspond to each other. We then solve using least squares for our matrix and reshape. To rectify images the following, I compute the homography from a set of four manually select points to another set that defines some rectangle. I then specify the points in the boundary I am going to warp, and multiply those with inverse of H. After some simple calculations, I get the points from the original image, which I can then use to get the correct colors into the newly warped image.

Original and Rectified to chalkboard

Original and Rectified to Lunchbag

Mosaics

We produce mosaics by taking photos of the same scene from the location but facing towards different directions, which some overlap between the pictures. Then we can warp and blend the pictures together. First we specify a center image, and warp the other image(s) towards that image. Then we figure out which parts of the warped and centered images overlap. Each unwarpped image has an alpha channel associated with it, where the center column is set to 1 and falls off linearly to 0 at the edges. If there is no overlap, then we just take the pixel values from the correct source. If there is overlap, then we take the alpha values at that pixel location. Then normalize them so they sum to 1 and apply the new alpha values to the pixel values at the respective source images, and use this value for the blended image. Any other pixel is set to zero, and we have a blended mosaic.

Original Images

The View from Doe Library

Original Images, Street near my apartment

Street

What I Learned

Homographies can produce amazing results, like showing a frontal view or recovering patterns of something an image is not directly looking at. Now I can produce a mosaic with image warps and blending.