CS 180 Proj 1: Images of the Russian Empire

Overview

During the last years of the Russian Empire, Sergei Mikhailovich Prokudin-Gorskii (1863-1944) travelled across the vast empire to capture images of everything he saw. In order to capture the colored images, he recorded 3 different exposures of every scene onto a glass plate using a red, green, and blue filter. In 1948, the Library of Congress purchased his images and were subsequently colorized. The goal of this project is to take the digitized glass plates and use modern-day image processing techniques, such as image pyramids, to produce colorized images.

Approach

For the smaller .jpg images, I used a simple x,y translation model to find the displacements for both the green channel and the red channel. Using the blue channel as a baseline, I overlayed the red and green channels over the blue channel. I utilized L2Norm and Normalized Cross-Correlation (NCC) to find the displacements that would output the most accurate recreation of the original image. After trying both measures, I found that L2Norm and NCC were equally as effective. I searched over a 15x15 pixel area for each channel, and used np.roll to shift the channel after finding the displacements. For preprocessing, I cropped 10% from each side of each channel before overlaying the channels. I found that cropping the sides before overlaying the channels generally produced better results.

For the larger .tif images, I used a pyramid search algorithm to find the displacements, as a naive approach would be significantly slower due to the large size of the images. I first created an image pyramid for each channel by downscaling the channels by a factor of 0.5 until the channel has 100-200 pixels. Then starting from the coarsest channel, I overlayed the green and red channels over the blue channel and ran the algorithm I used for the .jpg images to find the displacement. I then scaled up both the channels and the displacements until I reached the original image size while updating the displacements as I moved down the pyramid. After scaling up the displacement, I rolled the channel before finding the displacement at the next level. For preprocessing, I cropped 5% from each side of each channel before overlaying the channels. In the case of the Emir, I found that no cropping was more effective than cropping.

Results

JPG Results

Cathedral with cropping

Cathedral Image

Red Displacement: (12, 3)

Green Displacement: (5, 2)

Cathedral without cropping

Cathedral no crop Image

Red Displacement: (7, -1)

Green Displacement: (1, -1)

Monastery with cropping

Monastery Image

Red Displacement: (3, 2)

Green Displacement: (-3, 2)

Monastery without cropping

Monastery no crop Image

Red Displacement: (9, 1)

Green Displacement: (-6, 0)

Tobolsk with cropping

Tobolsk Image

Red Displacement: (6, 3)

Green Displacement: (3, 3)

Tobolsk without cropping

Tobolsk no crop Image

Red Displacement: (6, 3)

Green Displacement: (3, 2)

TIF Results

Church

Church Image

Red Displacement: (58, -4)

Green Displacement: (25, 0)

Emir

Emir Image

Red Displacement: (107, 17)

Green Displacement: (-3, 7)

Harvesters

Harvesters Image

Red Displacement: (124, 13)

Green Displacement: (60, 16)

Icon

Icon Image

Red Displacement: (89, 23)

Green Displacement: (40, 17)

Lady

Lady Image

Red Displacement: (117, 10)

Green Displacement: (53, 8)

Melons

Melons Image

Red Displacement: (178, 12)

Green Displacement: (82, 8)

Onion Church

Onion Church Image

Red Displacement: (108, 36)

Green Displacement: (51, 26)

Sculpture

Sculpture Image

Red Displacement: (140, -26)

Green Displacement: (33, -11)

Self Portrait

Self Portrait Image

Red Displacement: (176, 36)

Green Displacement: (78, 28)

Three Generations

Three Generations Image

Red Displacement: (112, 9)

Green Displacement: (54, 11)

Train

Train Image

Red Displacement: (87, 31)

Green Displacement: (43, 5)