CS 180 Project 1

Xavier Plourde

Overview

This project involved processing images from the Prokudin-Gorskii collection, which were given as blue, green, and red channels stacked on top of each other. The goal was to take in the single-channel images and combine them into one color image. The main challenge of the project was figuring out the offsets of the single-channel images relative to each other. For my implementation, I chose to stack the red and green channel images on top of the blue channel image.

For the smaller .jpg images, I used a simple brute-force algorithm to align the images, checking every possible translation in the range [-15, 15] both horizontally and vertically, and for both the red and green channels.

This was too slow on the large images, so for large images, I implemented a recursive pyramid strategy: whenever an image was below 500x500, I ran the brute-force algorithm, and otherwise, I resized the image to be half as large, ran the algorithm recursively on the lower-resolution image, multiplied the offset result of the recursive call by two, and looped over small offsets in the range of [0, 1] to potentially add to the offset computed recursively.

For both algorithms, I chose the offsets where the Euclidean distance between the color-channel images was as small as possible. This seemed to work well on all the images.

Results

Image: emir.tif, Green Offset: (48, 24), Red Offset: (103, 48)


Image: monastery.jpg, Green Offset: (-3, 2), Red Offset: (3, 2)


Image: church.tif, Green Offset: (24, 8), Red Offset: (56, -5)


Image: three_generations.tif, Green Offset: (56, 16), Red Offset: (112, 8)


Image: melons.tif, Green Offset: (84, 8), Red Offset: (184, 8)


Image: onion_church.tif, Green Offset: (52, 24), Red Offset: (108, 40)


Image: train.tif, Green Offset: (44, 8), Red Offset: (92, 32)


Image: tobolsk.jpg, Green Offset: (3, 3), Red Offset: (6, 3)


Image: icon.tif, Green Offset: (44, 16), Red Offset: (90, 24)


Image: cathedral.jpg, Green Offset: (5, 2), Red Offset: (12, 3)


Image: self_portrait.tif, Green Offset: (80, 32), Red Offset: (176, 32)


Image: harvesters.tif, Green Offset: (60, 16), Red Offset: (128, 16)


Image: sculpture.tif, Green Offset: (33, -8), Red Offset: (140, -24)


Image: lady.tif, Green Offset: (56, 8), Red Offset: (119, 8)