CS 194-26 Project 4

Shooting the Pictures

I used a DSLR and a tripod to shoot images of a wall at my parent's house, using exposure and focus locking, with significant field of view overlap. I additionally took a picture of a hallway in my house for rectification, using my iPhone to enable AE/AF locking. Additional mosaic photos were likewise taken with my iPhone using AE/AF locking.

Recovering Homographies & Image Warping

I first manually defined the correspondences between the two images, or in the case of image rectification, one image and an artificial rectangle. Overlapping field of view helps with image correspondence, giving a greater area to define correspondence upon, since manual correpsondence is easiest picking sharp edges or well defined, smaller objects. I have visualized the correspondences for a mosaic of my room

room-1 correspondence

room-2 correspondence

Image Rectification

hallway

Using the image of a hallway within my house, I manually defined seperates correspondence around a doorway and a mural, both perpendicular to the camera shooting direction, then computed the homographies with a manually defined rectangle [[0, 0], [w, 0], [0, h], [w, h]]. I have visualized the rectified images below:

hallway rectified (doorway)

hallway rectified (mural)

Mosaic

Source Images

house-1

house-2

room-1

room-2

wall-1

wall-2

After defining correspondence between the images, I designate a reference image and warp the other image to it, as visualized below:

house-1 warped

room-1 warped

wall-1 warped

After placing the images (warped and non-warped) into a empty image, which required specific predictive computations to determine output size, I initial used naive image blending to overlap the images, producing strong edge artifacts. I later reused my Project 2 multiresolution blending code to blend the images using a Laplacian pyramid scheme.

house-1 house-2 mosaic naive

house-1 house-2 mosaic

room-1 room-2 mosaic

wall-1 wall-2 mosaic

The coolest thing I learned in this project was the power of homographies. The concept of rectification is somewhat intuitive from a mathematical pov but absolutely mind-blowing in practice with images. Likewise, the potential for mapping surfaces using homographies in terms of mosaicing as well as non-projective mapping (which I wish I had time to explore) puts homographies among the coolest techniques I have learned in this class.

Arbitrary Image Mosaic

green room left

green room mid

green room right

Extending my implementation to support an arbitrary number of image vectors required some fine tuning to properly calculate output sizes, but the overall implementation follows the same formula. Currently my implementation only supports one set of correspondences, extending to support an arbitrary number of correspondences between arbitrary images would allow full panoramic, as opposed to the current ~180° field of view. I warp images taken to the left/right of a user-defined reference image towards the reference image using homographies, as visualized below:

green room left warped

green room right warped

Finally I used my Project 2 multiresolution blending implmentation to iteratively join the warped/ref images, calculating offsets to place them on the same image plane and then a mask for the Laplacian pyramid. The output is visualized below:

green room mosaic