Project 1: Color Alignment
Problem
This project addresses the problem of automatically aligning
a series of photographs that differ spatially by some
translational offset. Each photograph captures the same
imagery, though different exposure settings produce irregular
variations across the set of photographs, making this problem
more challenging.
The data used in this project comes from the
Prokudin-Gorskii collection .
Algorithm
To solve this problem, I implemented both a single scale and multi-scale
alignment algorithm, using a normalized cross-correlation metric to
score image similarity. In the single-scale implementation, each image
to be aligned was shifted over a window of translation offsets: [-25,25]x[-25,25].
While this approach produced nice-looking results, it took ~8 seconds to align
three relativey small images (~300x400px).
The multi-scale approach relied on producing a Gaussian pyramid of images,
in order to perform mult-level alignment where approximate offsets are
computed in low-res versions of the photographs, and subsequently refined in
higher-res versions. The pyramid was created by continually downsampling the
original images by a factor of 1/2, until the largest dimension of the smallest
downsampled image was less than 40 pixels. In my implementation, approximate
offsets were searched for over a 9x9 window ([-3,3]x[-3,3]). This produced
correct-looking alignments in significantly less time (~0.8 seconds for the 300x400px
images).
Extra credit
For extra credit components, I implemented automatic border-cropping, automatic
white balance, and automatic contrast enhancement.
My white balance algorithm follows the Retinex model, where only the red and blue
channels are adjusted, taking into account what is known of human visual perception.
The automatic contrast enhancement technique I implemented is known as contrast-limited
adaptive histogram equalization. As opposed to global histogram equalization, this
method operates on local regions of the image to produce sharp contrast.
Sample Results
Results from my project can be seen in the
Gallery .