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

Introduction

In the 1900s, Prokudin-Gorskii gained permission by the tzar to take pictures throughout the vast Russian empire. He recorded exposures of every scene on glass panes using red, green, and blue filters, envisioning the future world of colored images. This project seeks to reproduce the true color images using image alignment techniques.

Approach

First, out of curiosity, I tried to see how the image would look if I didn't do any alignment at all.

unaligned

Next, I tried displacements of rows and columns of the array representations to align the red channel with the blue, as well as aligning the green channel with the blue. This was done via scoring by Normal Cross Correlation to see essentially see which displacements would align best when measured by essentially a matrix dot product. I also cropped the edges of the images before measuring as they were not reflective of the true image. I found that the more cropping, the better results.

first try

I was pretty satisfied and so then I tried to apply this to the rest of the images. But then I found a few problems. The window of displacement [-15, 15] I had initially was not big enough for the tif images. When I widened the window, it also took much more time. So this is when I implemented image pyramid. I scaled down the tif files by half multiple times, applying the normal NCC to the smallest image, and adjusting the calculated shift by displacements of [-2, 2]. At one point, the displacement of [-15, 15] was not large enough for the smallest melons picture, so I changed the displacement to (-50, 50].

first_melons.jpg
melons.jpg

Observations

The smaller images were more blurry and possibly less aligned because of their limited number of pixels. For example, it wouldn't be possible to shift the pixels by a half, unless new pixels were computed to predict the new pixels between the existing pixels. This would artificially increase the size of the image and allow for more control in the amount of displacement of the channels.

Another observation is that notably, the emir.tif image failed by a large margin. This is because the emir's dress is very particular, which causes trouble with the alignment method that uses NCC. NCC tries to match darker pixels to darker pixels and lighter pixels to ligher pixels. Notice that the blue channel has the emir's darkness and whiteness inverted from the green and red channels. As a result, the positions are very off.

Blue

emir_blue.jpg

Green

emir_green.jpg

Red

emir_red.jpg

Bells & Whistles

In order to resolve the problem of the emir image, I instead use the Canny edge detector. I use the edge detector to detect the edges, with a dot product without normalization to maximize (because there is no benefit for adjusting for brightness from the result of edge detectors). I still use cropping to decrease error and the image pyramid technique for speed.

Edge Detection

Blue

emir_b_edges.jpg

Green

emir_g_edges.jpg

Red

emir_r_edges.jpg

Before

emir.jpg

After

emir_final.jpg

Results

The following pictures are the results of the first algorithm. Listed below each image is the displacement (rows, columns) of the green and red channels when aligning to blue. The improved algorithm based off of edge detection did not yield significantly better results for any photo besides emir.tif.

cathedral.jpg

cathedral.jpg

icon.tif

icon.jpg

onion_church.tif

onion_church.jpg

tobolsk.jpg

tobolsk.jpg

lady.tif

lady.jpg

train.tif

train.jpg

castle.tif

castle.jpg

melons.tif

melons.jpg

self_portrait.tif

self_portrait.jpg

workshop.tif

workshop.jpg

emir.tif

emir.jpg

harvesters.tif

harvesters.jpg

monastery.jpg

monastery.jpg

three_generations.tif

three_generations.jpg

Additional Images

ornament1.jpg ornament2.jpg cup.jpg