Images of the Russian Empire - Colorizing the Prokudin-Gorskii Photo Collection

by Kecheng Chen

Sergei Mikhailovich Prokudin-Gorskii traveled across the vast Russian Empire and took color photographs of everything he saw. His idea was simple: record three exposures of every scene onto a glass plate using a red, a green, and a blue filter. The goal of this project is to take the digitized Prokudin-Gorskii glass plate images and, using image processing techniques, automatically produce a color image with as few visual artifacts as possible.

Unprocessed BGR Images




Small images

Cathedral, using NCC (G:[5,2], R:[12,3])

Cathedral, using SSD (G:[5,2], R:[12,3])

Cathedral, using contrast enhancement in preprocessing

Monastery, using NCC (G:[-3,2], R:[3,2])

Monastery, using SSD (G:[-3,2], R:[3,2])

Monastery, using contrast enhancement in preprocessing

Tobolsk, using NCC (G:[3,3], R:[6,3])

Tobolsk, using SSD (G:[3,3], R:[6,3])

Tobolsk, using contrast enhancement in preprocessing

Large images (using NCC and contrast enhancement in preprocessing)





Onion church



Self portrait



My Approach

1. Crop images with specific percent

First, compute the height of each part. Then, separate the jpg or tif file into three color channel images. The borders of the images will probably hurt my results. In order to compute my metric on the internal pixels only, I set the special percent to be for example 10%, which means 10% of length and width are deleted from the left, right, top and bottom of the original image. See the following, Left is the original image and right is the image after cropping.


After cropping

2. Rescale and contrast enhancement in preprocessing

Rescale is doing the work of automatic contrasting, which makes the darkest pixel be zero and the brightest pixel be one. Then contrast enhancemnet is done in the green and red image based on the histogram of the blue image.



Contrast enhancement

3. Image matching metric

Sum of Squared Differences(SSD): The sum of squared differences measures the difference between two color channel images. The smaller the calculated value, the better the alignment.

Normalized Cross-Correlation(NCC): The normalized cross-correlation calculates the correlation between two color channel images. The bigger the calculated values, the more correlated the two channel images are, the better the alignment.

For example, both SSD and NCC are used in processing workshop.tif with the same parameters. It takes SSD 7.296585 seconds to compute and the result is (G:[52,0], R:[104,-12]), while NCC uses 22.801829 seconds to compute and gets the same result. Accroding to the reference, NCC is more accurate compared with SSD in the most conditions.



4. Image Pyramid

In the single-scale implementation, a small range of displacement [-15, 15] is selected for searching. But for high resolution images, exhaustive search becomes pretty expensive as pixel displacement is large. For this reason, image pyramid is used. Image pyramid speeds up the process by rescaling the image and works with the smaller copies. In my process, I set the number of pyramid levels to be 5. Searching range for the coarsest scale is set to be [-15,15] and for the other scales, it is [-5,5]. Scale factor is 2. Start from the coarsest scale, go down the pyramid and update the estimate. (previous_estimate_displacement*2=present_initial_displacement)

Image Pyramid

Bells and Whistles

Better features

Edge detection: an image processing technique for finding the boundaries of objects within images. It works by detecting discontinuities in brightness.

(1) Canny Edge Detection is a multi-stage algorithm - noise reduction, finding intensity gradient of the image, non-maximum suppression and hysteresis thresholding.

(2) Prewitt Edge Detection is used for detecting vertical and horizontal edges in images.

As shown in the following images, Canny can get more details compared with Prewitt.

Prewitt edge detection

Canny edge detection

Image gradient: directional change in the intensity or color in an image.

The Canny edge detector uses image gradient for edge detection.

Image gradient

Automatic white balance (postprocessing)

(1) Estimate the scene illumination.

(2) Correct the color balance of the image.

The gray world algorithm assumes that the RGB values are linear, so i changed rgb to linear color space and excluded the top and bottom 10% of pixels.

Preprocessing part is done in the My Approch section.


Gray World white balancing

Automatic contrasting (preprocessing)

Work of rescaling image intensities is done in the My Approch section. Histogram images are shown below.


Contrast enhancement

Automatic cropping

First, i changed the white pixel in the image to black. Then local standard deviation filter is used to detect edge or border. Although i could figure out where edges are based on the filtered image, it's hard to let computer know. So i check the histogram of suspected parts in each dimension and set 10% of each dimension as the threshold to determine the location of border. But this approach would make the whole process not automatic. Maybe i can figure out a clever way to realize real automatic cropping in the future.


White to black

Local standard deviation filter


After cropping

More images

Yusuf Hamadani mosque and mausoleum

Sirenʹ v Gatchinskom parki︠e︡

Ėtrusskīi︠a︡ vazy v Ėrmitazhi︠e︡ v SPeterburgi︠e︡

Adobe buildings and yurts


V Italīi