CS 194-26 Image Manipulation and Computational Photography

Project 1: Images of the Russian Empire: Colorizing the Prokudin-Gorskii photo collection

Mher Mnatsakanyan (cs194-26-aac)

Overview:

The goal of this assignment is 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. In order to do this, we need to extract the three color channel images, place them on top of each other, and align them so that they form a single RGB color image. Here is an example of each of the color channels from one of the images.

Cathedral (Red, Green, Blue)

If we simply place the channels on top of each other we will get a color image, but the colors will be off.
Simple alignment

Alignment:

We start by a simple implementation, where we exhaustively search over a window of possible displacements ([-30, 30] pixels) and compute L2 (NCC) distance between the pairs of channels and pick the (x, y) displacement which minimizes (in case of NCC maximizes) the distance. To do this, we need to fix one of the channels, for instance, blue, then separately move the other channels over the fixed channel and minimize the score. When computing the score we choose a central crop of the image (1/6th distance from the image borders) in order to avoid distortions and errors produces by the edges. In the end, we crop the 1/10th border of the images in order to avoid channel misplacement at the edges. In my experiments, I almost always did this procedure fixing each of the channels separately and visually checking for the blurriness. All the images illustrated in this section are the ones that were the best. This approach works relatively fast when the image size is not too large. We will handle large images in the next section. Here are some results:

Image Pyramid:

For larger images, simply searching for a displacement window is expensive since the distance computation can be very expensive. However, we already know how to handle small image sizes. We will recursively downscale the image with a certain factor (in our case by 1/2) until we reach to a fixed threshold (in our case 700x700) the align the color channels as before, then multiply the displacement coordinates with the reverse of rescaling factor (in this case 2). For instance, if we have a 1000x1000 image, we will downsample it to 500x500 then find the displacement, let's say (10, 30) which will become (20, 60) in the original image. Further, correction can be applied for each stage of the pyramid but the difference is hard to notice with the naked eye.

Here are the results for larger images:

Emir. Fixed Green, Blue (-24, -48), Red (16, 56)

Harvesters. Fixed Green, Blue (16, 56), Red (16, 120)

Icon. Fixed Blue, Green (-16, -40), Red (8, 48)

Lady. Fixed Blue, Green (8, 56), Red (8, 120)

Self Portrait. Fixed Blue, Green (32, 80), Red (40, 176)

Three Generations. Fixed Green, Blue (-16, -48), Red (0, 56)

Train. Fixed Green, Blue (8, 40), Red (32, 88)

Turkman. Fixed Green, Blue (-24, -56), Red (8, 64)

Village. Fixed Green, Blue (16, 64), Red (24, 136)