Project 1: Images of the Russian Empire:

Colorizing the Prokudin-Gorskii photo collection

Overview: In this project, we take images from the Prokudin-Gorskii photo collection and process them. Each pre-processed image consists of three color channel images (Blue, Green, and Red) which we align and combine to create a single color image.


Approach: Each image is split into three (BGR) and offsets are calculated for the G and R images by comparing them to B. For the small .jpg images, a simple exhaustive search is done over a small window of offsets to find the offset with the least Sum of Squared Differences in relation to B. Initially, the split images were used as is when calculating offsets. However, this did not work well for all images due to the black and white borders around each image, so the borders were simply cropped so that offset calculation would focus on the image content in the center. This produced good results for all images, and since the .jpg images were very small, the running time was almost instantaneous.


For the large .tif images, exhaustive search over an even larger window would take too long, so we instead use an image pyramid. Starting with the coarsest scale (based on factors of 2), offsets are calculated for very downscaled images and then used recursively to calculate offsets for less coarse scales until the original scale image is reached. This essentially allows for logarithmic runtime as opposed to exhaustively searching over thousands of potential offsets and calculating SSDs for massive images every time. Each .tif image only took about 5 seconds to process.


This produced very nice results with a few exceptions (emir.tif, village.tif, as well as a few additional downloaded images). The offsets on these images were off by a lot due to the different color channels not having the same brightness values. This was remedied by converting the BGR images into edge maps, essentially allowing images to be matched by their edges rather than based on pixel values. However, this also resulted in slightly lower quality images for other files, so edge map conversion was only used for specific files that needed it.


Finally, I found that starting with coarser scales in the image pyramid procedure made for slightly better image quality.

Filename & (x, y) offsets

Image

cathedral.jpg


G: (2, 5)

R: (3, 12)

emir.tif


G: (24, 49)

R: (40, 107)

harvesters.tif


G: (16, 59)

R: (13, 124)

icon.tif


G: (17, 41)

R: (23, 89)

lady.tif


G: (9, 51)

R: (11, 112)

melons.tif


G: (10, 81)

R: (13, 178)

monastery.jpg


G: (2, -3)

R: (2, 3)

onion_church.tif


G: (26, 51)

R: (36, 108)

self_portrait.tif


G: (29, 78)

R: (37, 176)

three_generations.tif


G: (14, 53)

R: (11, 112)

tobolsk.jpg


G: (3, 3)

R: (3, 6)

train.tif


G: (5, 42)

R: (32, 87)

village.tif


G: (10, 64)

R: (21, 137)

workshop.tif


G: (0, 53)

R: (-12, 105)

Example Images

Filename & (x, y) offsets

Image

armor.tif


G: (-15, 64)

R: (-31, 133)

chandelier.tif


G: (-5, 34)

R: (-26, 95)

clothing.tif


G: (-18, 25)

R: (-38, 115)

collection.tif


G: (-18, 25)

R: (-38, 115)

icon2.tif


G: (13, 50)

R: (19, 113)

mural.tif


G: (30, 18)

R: (37, 42)

stainedglass.tif


G: (16, 20)

R: (17, 60)

Additional Images