Computer Vision Project 1: Image Alignment and Color Compositing

Goal:

Take the digitized Prokudin-Gorskii glass plate images and automatically produce a color image with as few visual artifacts as possible. Extract the three color channel images and align them so that they form a single RGB color image.

Baseline (Naive) Implementation:

To align the RGB images, I decided to use the Normalized Cross Correlation metric as a baseline, because I noticed that it outperfomed sum of squared differences (SSD) on a small sample of test images.
My program divides the image into 3 equal parts, aligns the second and the third parts (G and R) to the first (B). For each image, I record the displacement vector that was used to align the parts.

Sample Single-Scale Processing Results

NCC final image

color image

G

green image

R

red image

B

blue image

However, since exhaustive search becomes expensive if the displacement search range/image resolution are too large, I implemented a second method for the high-res images: a multi-scale aligning algorithm that searches over a user-specified window of displacements.

Image Pyramids

To handle alignment for larger images, I used image pyramids to implement a faster search algorithm. Given two images, my image pyramid alignment algorithm recursively resizes images by factors of 2 at multiple scales, averages them by taking a uniform average of each, and respectively aligns them from the coarsest scale to the finest scale (largest image).

Image Pyramid Sample Results (from high res. scans)

color image color image color image

Bells and Whistles: Cropping with Edge Detection

Our overall goal is to reduce boundary noise in the dataset; thus, we need to crop the colorful, shifted borders. Hence, I used a combination of edge detection and averages to compute the cropping dimensions for each image. After generating the final color image by the alignment algorithms above, I use the following algorithm to crop the final image based on those computed dimensions.

Cropping Algorithm

Input: channel image I

Cropping and Edge Detection

Original Rcolor image Edge Detection Mapedge_detect_map Cropped Rred image

Sample Cropping Results

Before

image before crop

After

color image

Before

image before crop

After

red image

(More) Sample Results

red image red image
blue image red image