CS194 Project 1: Colorizing the Prokudin-Gorskii photo collection

By: Shaan Appel


Background

In this project, we sought to take the digitized Prokudin-Gorskii glass plate images and, using image processing techniques, automatically produce a color image with as few visual artifacts as possible. This primarily involves taking three separate RGB color channel images and aligning them to form a single color image.

Approach

In my initial approach I aligned two channels by shifting one channel both vertically and horizontally within a 15x15 search window. At each shift I calculated the sum of squared differences between the channels and chose the shift resulting in the smallest difference. Using this method I aligned the red and green channels to the blue channel.

To make this scale for larger images, I created an image pyramid by creating multiple scaled-down versions of the image and conducting a alginment search on each level, starting with the coarsest image. At each level I therefore calculate a finer, more precise shift.

I ran into difficulty with the Emir photo, as the red channel didn't align correctly using just the SSD metric. In order to fix this, I applied a canny edge detector filter to each image before aligning them. This remedied the problem (see bells and whistles)

Bells and Whistles

1. Using edges as the feature for alignment

I applied a canny edge detector filter to each channel and then align the modified channels with the SSD metric. This was especially useful for the emir photo, as the lack of red in the photo made alignment with just color channels very difficult. See example:

Using only SSD on RGB channels

Using SSD after applying edge detector

2. Automatic Contrasting

In order to provide greater contrast in the image I sought to create more expressiveness in the middle brightness ranges. In order to do this I found the brightest pixel and scaled it to be a bit brighter than white, forcing the brightest pixels all to be clipped to white. I then shifted the color of the pixels to achieve the same mean brightness, clipping some of the darkness pixels to black. This expands the brightness range of the middle values, creating more contrast. My scaling factor was picked from empirical observation.

Image after alignment (no extra contrast)

Image after automatic constrasting