Colorizing the Prokudin-Gorskii photo collection

Background

Sergei Mikhailovich Prokudin-Gorskii (1863-1944) photographed thousands of color pictures by recording three exposures of every scene onto a glass plate using a red, a green, and a blue filter. For the purpose of this project, I used digitized Prokudin-Gorskii glass plate images to generate clear color images by extracting each color channel and aligning them on top of each other.

Algorithm

My algorithm involved using a recursive image pyramid where images are downsized to 80% of current size at each step. We keep downsizing until the image height or width is smaller than 100 pixels, and we set this as our base case where we return the shift horizontally and vertically as (0, 0). In all other cases, we take the returned horizontal and vertical shift from the previous layer, and we roll the target image by 5/4 times the respective horizontal and vertical shifts. This is because dx and dy returned by the previous layer was resized to 4/5 (80%) the actual size. To calculate the shifts for the current layer, we calculate the Sum of Squared Differences across a window of [-15, 15] for both x and y and return the shift that produces the minimum Sum of Squared Differences. We also make sure to strip a small border around each image before taking the SSD so that we do not include rolled over pixels in our calculations.

Challenges

A challenge I faced while working on this project was figuring out how to deal with the rolled over pixels of each image. At first I chose to ignore those pixels when calculating the sum of squared differences but it did not seem to produce accurate results. I finally resorted to cropping a border of size 10% of the width of each image so that we would only try to align the center of the images. This produced draistically better results.

Small JPG Images:

Cathedral, G: (2, 5), R: (3, 12)
Monastery, G: (2, -3), R: (2, 3)
Nativity, G: (1, 3), R: (0, 8)
Settlers, G: (0, 7), R: (-1, 15)

Large TIF Images:

Harvesters, G: (16, 59), R: (13, 124)
Icon, G: (17, 41), R: (23, 90)
Lady, G: (8, 56), R: (12, 116)
Self Portrait, G: (29, 79), R: (37, 176)
Three Generations, G: (14, 53), R: (11, 111)
Turkmen, G: (21, 56), R: (28, 116)
Village, G: (12, 65), R: (22, 138)
Train, G: (6, 42), R: (32, 87)
Emir, G: (24, 49), R: (58, 102)