CS 194-26 Project 6A: Image Warping and Mosaicing

David Dominguez Hooper (cs194-26-abs)

Overview

In this project, I created a mosaic by taking pictures of various scenes, and selecting corresponding points to define a homography
matrix H, which I then used to transform the perspective of one image into another through rectification.
The results are then blended in order to create a whole mosaic, and repeated with more images.

These images were taken with a 12 PENTAX MX-1, and then digitized through Matlab.
We will be using these images to create the mosiacs.

First set of Images:

Left: Right:

Second set of Images:

Left: Right:

In order to rectify and warp images, first one must recover the parameters of the transformation between each pair of images.
In this case, the transformation is a homography: p’=Hp, where H is a 3x3 matrix with 8 degrees of freedom (lower right corner is a scaling factor and can be set to one).
One way to recover the homography is via a set of (p’,p) pairs of corresponding points taken from the two images.
In order to compute the entries in the matrix H, I set up a linear system of n equations (i.e. a matrix equation of the form Ah=b where h is a vector holding the 8 unknown entries of H)
where n is the number of point correspondences between the two images (determined through a simple click and select interface I wrote).
Since the system may be over-determined, I use least squares to solve for the eight unknowns in h, then reshaped it into a 3x3 matrix.


A homography matrix was created using input points selected using a correspondences tool.
The matrix was then used to warp the selected images into a rectified image.
Results for two images are shown below:



Zoomed in:

For each pair of images, we warp the left image by rectifying it into the right.
I used an alpha blend to blend the left image into the right.
We then get one single mosaic using the two images.





I enjoyed learning about image warping and homography because it taught me that creating panoramas isn't so hard!
I can also easily see how this can be used in various ways to create some really cool image effects and by applying a projection warp to an image,
we can unlock clues about an image by seeing it from a different viewpoint.