CS194 Project 1: Colorizing the Prokudin-Gorskii Photo Collection

Cesar Plascencia Zuniga

Overview

Sergey Mikhaylovich Prokudin-Gorskii was a pioneer in the field of color photography. He had the idea of using red, blue, and green filters on a "triple-lensed" film camera, essentially capturing each color channel in one shot. As a result, Prokudin-Gorskii was given approval by Tsar Nicholas II to travel around early 20th-century Russia and capture its beauty in color.

The Problem

Although Prokudin-Gorskii had the ability to capture images in color, his camera was not advanced enough to produce a single full-color image. The camera produced three frames for the same image -- a red channel, a green channel, and a blue channel. The goal now is to split each color channel with their respective color intensities and align the channels on top of each other.

Alignment on Small Images

Taking the three-channel input from above, first we can split the image into the three frames you see above. It turns out that the order of the frames from top to bottom is Blue channel, Green channel, and Red channel. With each of these channels split up, we must now choose a reference frame to align on top of. The following images used the Green channel as the reference. Once we choose our reference, we test different (x,y) coordinate displacements on our image to be aligned and see which displacement gives us the highest similarity to our reference. The metric used for the following images is the Sum of Squared Differences and the displacement window is 30x30 pixels. After aligning each channel to our reference, we stack all of the channels on top of each other and obtain our color image.

Cropping

As it turns out, our result here is not well-aligned. This is because the outer edges vary greatly across each color channel. This is most likely because Prokudin-Gorskii's camera lenses were stacked on top of each other, leading to slight differences on the edges of the frame. To fix this, we first crop each channel to only focus on the "inside"/center of each channel instead of the whole frame. Doing, so we obtrain the following result --

Alignment on Large Images

We are doing great so far! Truth be told, the monastery we were working with above is a small image (.jpg), thus the alignment displacement was not that large. However, once we test larger images (.tif) we will find that the alignment displacements can be much larger than what we can see in our 30x30 pixel window. This is what would result after running our current alignment on a large image.

Pyramid Alignment

Not so good, however we are not quite done yet. There is a way we can align large images using a pyramid scheme. No, not multi-level marketing, but decomposing our large image into a series of smaller-resolution images. Imagine we had a 1000x1000 pixel image. This would represent the base of our pyramid. The next level would be the same image downsized to 500x500 and so forth. At the top of the pyramid, we have an incredibly small resolution image that is easy to operate upon. We use this idea to implement pyramid alignment, where we find the best displacements at the top of the pyramid and pass that information to each of the lower levels of the pyramid. Once we reach the base of the pyramid, we no longer have to search the whole image, only a small section of it since the higher levels already told us approximately where to start searching. After implementing pyramid alignment, we can achieve the following results--

Hiccups

If you look closely, the last image of Emir did not come out properly aligned. This is because Emir's robe varies drastically in color intensities. There is a great amount of intensity in the blue channel while the red channel is not nearly as active. This problem becomes even worse when we consider that we only care about the alignment at the center of the image.

Extensions

To solve this issue and produce better quality images in general, we can implement various other features that can smooth out these imperfections. This includes feature-based alignment, auto white-balancing, and even alignment using edge detection.These implementations are encouraged to achieve better quality photos, but for now the current results suffice.

The Colorized Collection

With (x,y) displacement values for Green and Red channels aligned on top of Blue channel.

G:(2, -3), R:(2,3)
G:(3, 3), R:(3,7)
G:(2, 5), R:(3,12)
G:(27, 51), R:(37, 108)
G:(10, 82), R:(14, 178)
G:(8, 52), R:(12, 112)
G:(17, 41), R:(23, 90)
G:(6, 42), R:(32, 86)
G:(-1, 54), R:(-12, 106)
G:(17, 59), R:(14, 123)
G:(24, 48), R:(13, -40)
G:(14, 52), R:(12, 111)
G:(2, 34), R:(4, 98)
G:(29, 78), R:(37, 175)
G:(6, 44), R:(11, 161)
G:(0, 80), R:(-12, 162)
G:(21, 47), R:(33, 106)
G:(-22, 49), R:(-54, 106)

Thank You For Viewing!