Project 1: Colorizing the Prokudin-Gorskii photo collection

Jiayue Tao, CS194-26-adl



Project Overview

In this project, I colorized the black-and-white photos taken by 20th century Russian photographer Prokudin-Gorskii. Each of the initial glass plate images contains three images of the same scene, taken with a red, blue, and green filter respectively. Therefore, in order to construct the color photo, we need to separate the three color channel images, place them on top of each other with their pixel value representing the intensity of R, G, or B values, and then align them to form one coherent colored image.

First, I cropped 2% of the image both horizontally and vertically to remove the blank or black edges from the glass plate image. Then, I simply cut the image into three chunks, and used the top (Blue) block as the reference for the Red and Green blocks to align with. For smaller jpg images, I just searched over a (-25, 25) window of displacements and found the best match based on the lowest Sum of Squared Differences (SSD). For larger tif files, in order to speed up the algorithm, I implemented a recursive image pyramid to scale down the image until reasonable size (512 by 512 was my threshold) and then look for the best displacement in this coarse image. I then update this value each time I rescale the image back to finer scale and do a finer search. At each layer of the pyramid, I search over a (-15, 15) window of x, y displacements. Because computing the SSD of two entire blocks are computationally expensive, I cropped out only the center portions of two images to compute SSD, which can give alignment that do not have any visible difference from the slower complete SSD comparisons.

Colorized Results

Here are the colorized images, along with some other cool photos I found in the collection.


Cathedral, Offset: G(-8, 2), R(-14, 3)
Tobolsk, Offset: G(-10, 2), R(-20, 3)
Monastery, Offset: G(-16, 0), R(-23, 0)
Self-portrait, Offset: G(-52, 28), R(-85, 36)


Bridge, Offset: G(-82, -9), R(-149, -15)
Onion Church, Offset: G(-79, 26), R(-150, 37)
Village, Offset: G(-65, 13), R(-123, 23)
Icon, Offset: G(-88, 18), R(-170, 23)

Harvesters, Offset: G(-69, 18), R(-133, 15)
Train, Offset: G(-86, 6), R(-172, 32)

Art, Offset: G(-66, 28), R(-125, 32)
Melons, Offset: G(-45, 10), R(-78, 13)
Emir before Sobel filter, Offset: G(-76, 23), R(-149, 69)
Emir after Sobel filter (better), Offset: G(-80, 23), R(-151, 41)

Finally, for bells and whistles, I applied a Sobel filter on the R, G, B blocks before searching for best alignment because this will single out the edges of objects in the scene and therefore help get a better match. This helped especially to match the emir image. Without Sobel, the three blocks’ sharp difference in saturation caused the simple SSD to not work well. The output is considerably better with the Sobel filter, as one can see in the above before-and-after images. All the other images in this page is also processed with the Sobel filter, except for the lady.tif.

Lady before Sobel filter (better), Offset: G(-76, 7), R(-130, 14)
Lady after Sobel filter, Offset: G(-76,7), R(407,22)

For the lady.tif, I found that the effect without Sobel filter is much better than with the Sobel filter, and I believe it is due to the fact the this image does not have so many sharp edges, so much information is lost if we only take the Sobel filtered images to compare. Therefore, the image of the colorized lady.tif is done without Sobel.


Door, Offset: G(-64, 18), R(-123, 38)
Three generations, Offset: G(-78, 18), R(-147, 14)
Workshop, Offset: G(-76, 0), R(-152, -12)