CS194-26: Image Manipulation and Computational Photography, Fall 2017

Project 6: Image Warping and Mosaicing

Sudeep Dasari (cs194-26-aae)



Overview

The primary purpose of this project was to explore image mosaicing by warping images taken from different points of view into the same coordinate space. After taking digital images keypoints are manually annotated by the user, a homography is computed, and then used to transform the images (using a projective warp) into the same coordinate frame. Finally, the transformed images are composited to create the final result.



Computing Homographies

Computing the homography is a two-step process: first the user finds and marks the same keypoint in each image, and then a projective transformation between the two sets of points is computed. Given a pair of points (x, y) and (x’, y’) the following equations can be written:

x’ = ax + bx + c – gxx’ – hyx’

y’ = dx + ey + f – gxy’ – hyy’

For n points, the solution to the system of 2n equations can be approximated using least squares regression.

Image Rectification

The computed homographies can be used for a cool application: rectifying images! In this example a picture of tiled flooring is taken from a slanted viewpoint, so the tile no longer looks square. A homography between the original image space and a top down view of the square tile is computed, and the image is warped into those coordinates. From this viewpoint the square shape of the tiles is clearly visible!

Original Tiles Source
Rectified Image

Image Mosiacing

Mosaics are computed by computing homographies between the images, and warping them into a shared coordinate space. At this point the geometry of the images are overlaid, but – unfortunately - the colors are slightly different because of my phone camera’s automatic exposure settings. In order to alleviate this the image are composited with multi-resolution blending. The final result has a much less obvious seam.



Golden State Park Mosiac

Image One
Image Two
Final Mosiac


Cal Academy of Science Mosiac

Image One
Image Two
Final Mosiac

Lessons Learned

I learned how to register images in 3D. Going in I really underestimated the amount of effort required to manually annotate and stitch the images. This project used concepts from the entire course (aka blending and warping), and I thought it was interesting how everything came together at the end.

The project is not fully over yet, so hopefully I can address some of the bells and whistles in this part later! I would like to explore cylindrical coordinates later in the project, and want to get a more suitable cameras to reduce artifacts in my mosiacs.