Project 1 - Images of the Russian Empire: Colorizing the Prokudin-Gorskii Photo Collection

Louise Feng

Overview:

In the early 1900s, Sergei Mikhailovich Prokudin-Gorskii traveled through Russia to take color photographs. Today, I sit in Moffitt and imitate his process. Given the digitized exposures he took - grayscaled and filtered red, green and blue - my program processes them to create a composite image that realistically and clearly portrays the colored scenes.

Procesing Small .jpg Negatives

We retrieve the negative and divide it evenly along its height to separate the three channels. In order to make these negatives easier to align, I trim 10% off the outer area on each side, eliminating the irrelevent borders and preventing them from scewing alignment attempts. Then we start aligning. Both the red and the green channels are aligned against the blue. To align, we slide along a translation ranging [-15, 15] through both axes. This window was chosen given some experimentation. While it was recommended, I wanted to see how the optimal alignment might change with the range of translation. It quickly became pretty clear that with less, many of the images would come out blurry and misaligned. With any more, the process became slow, and the optimal alignment would still at max hover around 15. And so I stuck with it. At each step, we compute the score of that step using the L2 norm or the sum of squared differences of the translated image with the base (blue) by simply calling `np.linalg.norm([translated red/green channel] - blue)`. In the process of optimizing alignment, I later chose to only score on the middle of the images, removing any external influences (ex. borders), and minimizing the area I needed to compare over. It seems that cutting off 0.3 from each side works well and retains the quality of the alignment. Ultimately, the displacement with the best (lowest) score is the the correct translation to use. With the translated images, we overlay each, producing the best composite. This process works well with all of the .jpg images and only takes a matter of ~2 - 3 seconds to complete.

Procesing Large .tif Negatives

On the other hand, it's much more arduous to replicate the previously described alignment process on the .tif images, which are much much larger. In this case, the previous search method would be both expensive and inaccurate. Instead, we implement pyramid search. Using this method, we can search more at lower resolutions, and narrow down the best displacement window before fine-tuning at higher resolutions.

Image Pyramid Method
With this new method, we can hope to process larger images much faster, while still offering accuracy. Again we start with the 3 grayscales cropped on the outer 10%. Instead of directly aligning, we first scale the image by calling `skimage.transform.resize()` on both the images we're comparing. The initial resize factor I went with was 32, chosen for the accuracy in the ultimate alignment when used, while also staying under a minute to run. Now that we've refactored, the images are magnitudes smaller and also magnitudes easier to align, albeit only roughly because it was resized by such a large factor. In the first alignment, I keep the window at [-15, 15] to ensure that we can roughly determine the displacement values to use. To continue fine-tuning, given the general local location, we resize the image again by half the factor (retaining double the amount of precision as the preceding resize) and compare the now clearer images, but in a smaller window of [-5, 5]. Ultimately, by the time we've resurfaced to the original size, we have a pretty precise alignment (yay).

In implementing the image pyramid, 2 images gave me some trouble: village.tif and emir.tif. The red channel of the village scene wouldn't align given the same implementation used on the other .tif images. In fact, it didn't want to displace at all from its original form. This was fixed by changing the size of the middle area compared in alignment to 0.2 (from the original 0.3). Also, when attempting to align the red and green channels with the blue channel for emir.tif, the results are subpar (read: really bad). A much better result can be obtained by aligning red and blue with green.

Results

Cathedral:

Monastery:

Nativity:

Settlers:

Emir:

Harvesters:

Icon:

Lady:

Self-Portrait:

Three Generations:

Train:

Turkmen:

Village:

[Extra] Interesting Building:

[Extra] Clothes:

[Extra] Flowers:

[Extra] Peasant Girls:

[Extra] Rubble: