CS 194-26 Project 6: [Auto]Stitching Photo Mosaics

Author: Kevin Ji

Recover Homographies

Using a series of photos that exist within the same projective space, we compute the homography transformation matrix via the process listed here. This matrix is computed for each pair of overlapping images, after either manually specifying point correspondences via plt.ginput, or automatically computing the correspondences (see below).

Image Rectification

A simple application of the homography-generating function is to rectify an image. In other words, we provide a set of point correspondences from an image to a set of points in a rectangle, and then warp the rest of the image via the same transformation matrix.

Below are some examples of images and their rectified versions.

Hyperbole and a Half

Asha Tea House

Image Mosaics

Of course, the real purpose of generating these homographic matrices is to merge multiple images together into one nice image mosaic. To do so, we incrementally merge each successive photo with the current in-progress photo, starting with the first two photos. We use the Euclidean distance from the center of the photo as an alpha value at each pixel, and then merge pairs of photos via Porter and Duff's alpha-blending equations.

For the second part of the project, point correspondences were automatically found, via the following algorithm:

  1. Using the Harris Interest Point Detector, determine points in two images that are likely to be corners, which are the points of interest.
  2. To evenly spread out interest points across both images, use Adaptive Non-Maximal Suppression to select which of the Harris corners to keep.
  3. In order to provide a feature vector for each interest point, compute the corresponding SIFT feature for each point by looking at 8x8 patches.
  4. Match the features by comparing distances between the feature vectors, using the ratio between 1-NN and 2-NN matches as a filtering ratio.
  5. Using 4-point RANSAC, choose the best homography matrix to map from one image to another image.

Below are a few examples of the following:

Moe's Books

Sather Gate

Doe Library