Images of the Russian Empire:

Colorizing the Prokudin-Gorskii Photo Collection



In 1907, Sergei Mikhailovich Prokudin-Gorskii envisioned a way to take color photographs before anyone thought it was possible. By shooting three separate exposures of a scene using red, green and blue filters, he was able to document daily life in the late Russian Empire. The Library of Congress has since digitized Prokudin-Gorskii's original glass plate negatives (see left) and colorized them by aligning, stacking, and manually adjusting the three color channels to create RGB color images (see right). This project is an attempt to recreate the LOC's efforts automatically, using python and image processing techniques to colorize the collection.

Approach



The first step is to separate the three-panel negative into equal chunks, corresponding to each color channel.




Then we stack them on top of each other. But it's not quite what we wanted. There's an alignment issue.




Fixing the color channel alignment makes up the bulk of this project. We will need to shift the red and green channels by some (x,y) offset to match the blue channel. Searching over a range of 15 pixels in each direction, we select the (x,y) offset that produces an shifted green channel that best matches the blue channel in pixel intensities. We'll estimate the best match by choosing the minimum SSD (sum of squared differences) between the pixels of each image. This step is repeated for the red channel.




For larger images, we cannot exhaustively search for the (x,y) offsets. We must use an image pyramid to optimize this search. Starting with the original image, we reduce the resolution until it becomes a manageable size. Then we use the same SSD method to calculate an ideal offset based on pixel intensities. Gradually, we can adjust and improve the offset, searching around its vicinity as we increase the image resolution, until we get a precise scaled-up offset at full resolution.




Optimizations


Using this approach gave us some decently aligned images. However, some images needed a better metric than our pixel SSD metric to be aligned properly. The emir's intense blue outfit meant that the pixel intensities on the blue channel were quite different than those on the green and red channels.




Instead of running SSD on the original pixel intensities, we can use an edge detection algorithm to simplify the image before calculating the offsets. The Roberts cross operator convolves two 2x2 filters (across diagonal pixels) over the image to identify edges. This operator is a good choice because it is quick, lightweight and available in the skimage.filters library. Running SSD on the edge detected image produces a much better result.


Results


The final images and their offsets produced by edge detection SSD.


cathedral.jpg: green (2, 5) red (3, 12)

monastery.jpg: green (2, -3) red (2, 3)

lady.tif: green (0, 59) red (0, 99)

emir.tif: green (23, 48) red (41, 106)

self_portrait.tif: green (29, 77) red (23, 187)

village.tif: green (13, 64) red (23, 137)

workshop.tif: green (0, 53) red (-11, 106)

sheep.tif: green (36, 74) red (52, 156)

women.tif: green (2, 16) red (1, 102)

boat.tif: green (-7, 12) red (-13, 134)

tobolsk.jpg: green (3, 3) red (3, 7)

icon.tif: green (18, 40) red (24, 89)

harvesters.tif: green (19, 59) red (18, 123)

melons.tif: green (0, 83) red (0, 192)

onion_church.tif: green (26, 49) red (37, 107)

three_generations.tif: green (15, 50) red (0, 102)

train.tif: green (6, 42) red (32, 85)

sunset.tif: green (0, 63) red (0, 130)

girls.tif: green (10, -13) red (19, 12)

dudes.tif: green (0, 38) red (-15, 80)

About

Course project for CS 194-26 Image Manipulation and Computational Photography.

By George Wang. January 2020.

Website template: HTML5 Templates