CS 180 Project 1 - Coloring the Prokudin-Gorskii Collection

For this project, my task was to color these photographs originally captured by Prokudin-Gorskii. My strategy for this was to take the same photograph with blue, green, and red color filters and then stack the photos on top of each other to create a fully-colored image.

Implementation Details

The original files that we used are in the format of a picture's three RGB channels stacked vertically on top of each other. The method I used for creating these colored images is described as follows.

Preprocessing

First, we slice the input image into the three color channels simply by slicing the image vertically into equal parts, separating the three channels from each other. Afterward, I cropped 15% off of each side of each image.

Naive Implementation

I then worked on aligning the red and green color channels with the blue color channel. This required implementing a function that would take two images and find the optimal shifting of one image onto the other, with the goal of maximizing the two images' structural similarity index.

For the naive implementation (for lower-resolution images) of this function, I searched in the range of [-10, 10] in both vertical and horizontal axes for the optimal translation of the shift image in order to maximize its structural similarity with the target image.

General Implementation

However, for higher resolution images, of this function, it is not feasible to naively search a useful range of potential image shifts, due to the increased pixel density. Instead, I utilized an image pyramid strategy. Shortly put, we construct an image pyramid, or a sequence of images consisting of consecutively lower and lower resolutions of the original high-resolution image, for each color channel. I stop appending images once my images become less than 64 pixels in height.

Once each channel's pyramid is created, I run the naive implementation on the lowest-resolution image to find the optimal shift values. I then iteratively descend the pyramid, using the previous optimal shift values for lower-resolution images as estimates to inform the ranges I search on higher-resolution images, as I can now narrow my search space to be centered around the optimal translation computed in the previous iteration. This algorithm will efficiently find the optimal alignment even for large .tif images, for which it takes about 5-6 minutes per image.

Handpicked Images