CS194-26: Image Manipulation and Computational Photography

Spring 2020

Project 5: Photo Mosaics and Auto-stitching

Kamyar Salahi

Overview

This project consists of utilizing projective transformations in order to generate mosaics as well as rectifying images.


Part 1: Warping and Mosaics

Rectification -  we want to warp an image into a rectangular equivalent. This can be achieved through a homography, which

is essentially a mapping between two images taken on a planar surface. The homography can be written as a perspective

transformation vector with eight degrees of freedom. This means that given a set of four correspondence points, we will

be able to generate the homography mapping one image to the planar equivalent. By selecting correspondence points on

a portion of the photography that should be linear and then using a set of rectangular correspondences, we can rectify an

image.








The a-h positions on the matrix are the eight degrees of freedom. The i is by default a 1.


Using the perspective transform, we can create a system of linear equations which we can solve directly. In the case that

more than four correspondences are used, we can use least squares to minimize noise in correspondence points and

create a more accurate homography.


We then use inverse warping to generate the rectified photos.


Original Image                                                                 Rectified Image                                                                       Bird’s Eye View


In case anyone was wondering, the above poster is a painting by Istvan Orosz that actually has a face (Jules Verne) hidden inside via a cylindrical projection. (This projection is shown above.)


As you can see, the images look a bit off when compared to the “bird’s eye view.” This is because the homography is mapping between two images on the same planar surface. The result is that depth is not really preserved in the way one may anticipate (the shadow box shows this brilliantly) and the iridescence of the blue morpho will not be visible from the plane that is not directly parallel to it. As a consequence, we get some part of the fly covered by the shadow box and do not see the iridescence of the butterfly.