CS294-26: Project 1

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

Siyi Ji

Introduction

Sergei Mikhailovich Prokudin-Gorskii (1863-1944) [Сергей Михайлович Прокудин-Горский, to his Russian friends] was a man well ahead of his time. Convinced, as early as 1907, that color photography was the wave of the future, he won Tzar's special permission to travel across the vast Russian Empire and take color photographs of everything he saw including the only color portrait of Leo Tolstoy. His idea was simple: record three exposures of every scene onto a glass plate using a red, a green, and a blue filter. Never mind that there was no way to print color photographs until much later -- he envisioned special projectors to be installed in "multimedia" classrooms all across Russia where the children would be able to learn about their vast country. Alas, his plans never materialized: he left Russia in 1918, right after the revolution, never to return again. Luckily, his RGB glass plate negatives, capturing the last years of the Russian Empire, survived and were purchased in 1948 by the Library of Congress. The LoC has recently digitized the negatives and made them available on-line.

In this project, we will be constructing the color images from the RGB channel images by placing them on top of each other and applying several techniques.

Approach

Image Alignment

The input is a glass plate image taken on three different filters: red, green and blue. We first divide the image into three equal parts: B, G, R and we want to stack these channels to produce a single colored image.

To align two color channels, we exsausively search an offset window of [-15, 15] along both x and y axises, measure each one using some metric, and take the displacement with the lowset score.

I used Sum of Squared Differences distance (SSD) as my metric. Here are some images produced using only exsausive search and without pre-prossessing.

Displacement to align G to B: (1, -1), R to B:(7, -1)
Displacement to align G to B: (-6, 0), R to B:(9, 1)

Some Improvements:

1. Central Alignment

Instead of aligning the whole images, we align only the central regions of the images as the borders contain too much noise. To do this, I cropped 60% of both channels from the center, and calculated the displacement vectors using the SSD metric. Then, I used the displacement vectors to offset the original images and stacked them together.

Displacement to align G to B: (5, 2), R to B:(12, 3)
Displacement to align G to B: (-3, 2), R to B:(3, 2)

2. Image Pyramid

For high-resolution images(.tif), exhaustive search becomes expensive as the pixel displacement is too large (takes more than 3 minutes). We use an image pyramid approach for these large images. Image having a pyramid, where the bottom level is the original, and each time we go up a level we downscale the image by a factor of 2 until the downsized image is small enough to perform an exsausive search. We obtain an offset estimate from each level and we use previous level's estimate as a starting point to calculate the new estimate. The end result is an offset value for the original images. In my implementaion, I used a level of 8 and a search window of [-5, 5] on each level. The process took less than 1 minute.

Displacement to align R to B: (123, 14), G to B:(59, 17)
Displacement to align R to B: (89, 23), G to B:(40, 17)

3. Base Channel

The above approach does not work for emir.tif. The red channel is far off on the left. Instead of using the blue channel as base, I switched to using the green channel as base and this fixed the problem.

Displacement to align R to B: (0, -677), G to B:(49, 24)
Displacement to align R to G: (57, 17), B to G:(-49, -24)

4. Border Cropping

To remove the color strips on the border of the images, I cropped a fixed-ratio (5%) on all the borders before aligning.

Displacement to align R to G: (57, 17), B to G:(-49, -24)
Displacement to align R to G: (33, -8), B to G:(-25, -4)

Gallery

R to G(7, 1), B to G(-5, -2)
R to G(60, 4), B to G(-50, -8)
R to G(96, 3), B to G(-81, -10)
R to G(57, 10), B to G(-51, -27)
R to G(98, 8), B to G(-78, -29)
R to G(59, -3), B to G(-51, -14)
R to G(6, 1), B to G(3, -2)
R to G(64, -3), B to G(-59, -17)
R to G(48, 5), B to G(-41, -17)
R to G(33, -8), B to G(-25, -4)
R to G(57, 17), B to G(-48, -24)
R to G(4, 1), B to G(-3, -3)
R to G(43, 26), B to G(-42, -6)
R to G(52, -11), B to G(-53, 1)