CS194-26 Project 1: Images of the Russian Empire: Colorizing the Prokudin-Gorskii photo collection

Josh Zeitsoff, cs194-26-abi

Project Overview

Sergei Mikhailovich Prokudin-Gorskii recorded exposures of many scenes in Russia using red, blue, and green filters, envisioning a future when we would be able to print color photographs. Our project was to take digitized images of glass plate negatives containing the 3 colored images (red, blue, green), extract each color channel, and align them on top of each other in such a way that there are as few errors as possible.

My Approach

I began by first attempting to align the smaller images. First, I extracted out the 3 color channels from the given input images. At this size, I cropped about 6% of the image borders, since we wanted to better align the images by focusing on the color in the center. I then attempted to align each of the red and green images with the blue by searching over a small area of displacement, say [-15, 15] pixels. At each displacement, I computed the Sum of Squared Differences between the pixels of the two images, and took the displacement in the x-direction and y-direction that gave the smallest SSD.

For the larger images with more pixels, this approach is highly inefficient. For these images, I implemented an image pyramid. I chose an image pyramid with 3 levels, so I scaled down each of my images by a factor of .5 at each level. At the smallest level, I ran the alignment algorithm as above, since the images were now small enough that computing the SSDs was not inefficient. I propogated each of these displacements to the next largest level in the image pyramid, remembering to scale them by the inverse of the original scale_factor (so 2 in my case). I also cropped these images at the same percentage, ~6%, to align based on the color in the center and not the black borders.

Images

Small JPEG Images

settlers.jpg

Green Displacement [7, 0], Red Displacement [14, -1]

monastery.jpg

Green Displacement [-3, 2], Red Displacement [3, 2]

nativity.jpg

Green Displacement [3, 1], Red Displacement [7, 1]

cathedral.jpg

Green Displacement [5, 2], Red Displacement [12, 3]

Large TIF Images

emir.tif

Green Displacement [64, 12], Red Displacement [126, 8]

harvesters.tif

Green Displacement [60, 16], Red Displacement [124, 14]

icon.tif

Green Displacement [40, 16], Red Displacement [90, 22]

lady.tif

Green Displacement [48, 8], Red Displacement [112, 12]

self_portrait.tif

Green Displacement [78, 28], Red Displacement [126, 0]
My algorithm did not do so well on this image, as you can see in the overall misalignment of the river rocks as well as the hills in the background. I believe it is because there are many edges in this image and I did not implement edge detection, which I could've done with a Sobel filter to smooth out the edges.

three_generations.tif

Green Displacement [52, 14], Red Displacement [112, 10]

train.tif

Green Displacement [42, 4], Red Displacement [88, 32]

turkmen.tif

Green Displacement [56, 18], Red Displacement [116, 26]

village.tif

Green Displacement [64, 12], Red Displacement [126, 8]
My algorithm wasn't perfect on this image, as you can see in the slight fuzziness of the building in the background. I believe it is similar to why my algorithm did not perform well on self_portrait.tif, as there are many edges and I did not implement edge detection with a Sobel filter.

Additional Images

vendors.tif

Green Displacement [42, -4], Red Displacement [94, 0]

new.tif

Green Displacement [14, 20], Red Displacement [36, 26]
I actually found this output very interesting. The reason for the yellow in the sky is due to the orignal image having one of the filters be all black. However, trimming this from the image isn't possible, as the other 2 images have a perfectly clear sky. I hypothesize that perhaps it is the green plate that had a black sky, and this is why the sky shows up as primarily greenish yellow.

waterfall.tif

Green Displacement [16, -2], Red Displacement [84, -8]