CS 129 Project 1: Image Alignment

Image Alignment with Pyramids

Marvin Arroz (marroz)
September 17, 2012

Motivation

Early color photos were produced by recording three exposures of the same scene, one with a blue filter, one with a green filter, and one with a red filter. Our goal is to take these three separate greyscale images and align them with an alignment algorithm to produce a full color image.

The Algorithm

In order to efficiently align the three greyscale images to produce the color image, I use the method of image pyramids. The algorithm is run twice: once to align blue and green, and once to align blue and red.

I first rescale the two images by a factor of two a variable number of times depending on the sizes of the original images. I stop rescaling the images when they get small enough (at the smallest 400X400). For the smaller jpgs, this means I may only rescale by a factor of two. Once I have the smaller versions of the original greyscales, I perform my alignment algorithm.

First, I look at a window in the center of the two images. I use the sum of squared differences on each of the two windows (elementwise) and check 225 different shifting windows. I keep track of the minimum window then rescale the image up by two. I scale up my shift vector by two and now check the adjacent 8 shifting windows to find the new minimum. I repeat scaling up the image, updating the shift vector, until I reach the original size. I check the sum of squared differences on the original images in 9 shifting windows around my shifting vector to verify that there isn't a more optimal window.

Images