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

Daniel Zheng - cs194-26-acj

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, I 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.

Part 1: Single-Scale Implementation

Since the jpg files are small, it is enough to use for loops to search the image for a window of displacements for the best result.

I found the minimum L2 norm between the R and B channels as well as the G and B channels in a [-15, 15] displacement window. After finding the best shifts, I shifted the R and G channels and then recombined all 3 channels to form the resulting colorized image.

At first, I tried to calculate the L2 norm for all possible shifts of one channel against the other channel, but I found that it took way too much time to obtain a result. Therefore, I limited my search to a [-15, 15] window as most of the channels did not have large displacements to begin with. Another issue that I faced was that some of the channels were not aligning correctly even after I found the minimum L2 norm. I managed to fix this by cropping more of the image - I found that cropping 5% off each border was not enough so I increased it to 7%.

Images and displacement values

Cathedral
cathedral.jpg - G: (5, 2), R: (12, 3)
Monastery
monastery.jpg - G: (-3, 2), R: (3, 2)
Nativity
nativity.jpg - G: (3, 1), R: (7, 0)
Settlers
settlers.jpg - G: (7, 0), R: (14, -1)

Part 2: Multi-Scale Implementation

For larger images, the search window of [-15, 15] may not be enough to find the best displacement. Due to the size of the images, an exhaustive search over a larger search window would take too long. Therefore, I used an image pyramid to repeatedly downscale the large image until it is a manageable size, which I set to be a size less than 300x300. I apply the single-scale alignment procedure on this downscaled image. Afterwards, I scale the aligned image back up and search in a [-3, 3] range for the displacement in the larger image. This is done to fine-tune the image displacement to ensure that the images are aligned in the best possible way. This process is repeated until the images have been scaled back up to the original size.

Images and displacement values

Harvesters
harvesters.tif - G: (60, 16), R: (124, 13)
Icon
icon.tif - G: (40, 17), R: (89, 23)
Lady
lady.tif - G: (53, 8), R: (117, 10)
Self Portrait
self_portrait.tif - G: (78, 28), R: (176, 36)
Three Generations
three_generations.tif - G: (54, 11), R: (112, 9)
Train
train.tif - G: (43, 5), R: (87, 31)
Turkmen
turkmen.tif - G: (56, 19), R: (115, 26)
Village
village.tif - G: (64, 11), R: (137, 21)

Issues with emir.tif

I had some issues with the image emir.tif. When I used the same image pyramid alignment scheme as the other .tif files, I found that the red channel ended up being misaligned. This was because the blue channel was much brighter than the other channels. I was able to fix this issue by aligning on the green channel instead.

Emir Blue Channel
emir on blue channel - G: (49, 24), R: (0, -200)
Emir Green Channel
emir on green channel - B: (-49, -24), R: (57, 17)

Other examples

Here are some other examples, colorized by me, that I chose from the Prokudin-Gorskii collection.

Arch
arch.tif - G: (73, 22), R: (154, 35)
Church
church.tif - G: (43, 13), R: (96, 10)
Cups
cups.tif - G: (24, 20), R: (72, 33)