project image

Images of the Russian Empire


The project involves the task of creating color images from three different images containing the red, green and blue. The initial approach involves searching over a window of displacements (the pictures below use (-15, 15)) and chooses the displacement with the minimum value of an error metric (the pictures below use the sum of square difference metric).

While this approach works well for smaller images like the ones shown below, the number of displacements to search for becomes computionally expensive as the size of the image increases.

cathedral no bordermonastery no bordertobolsk no border

In order to align the bigger TIF images in a reasonable amount of time, a recursive implementation of the image pyramid algorithm was used. This involved scaling down the image until it is less than 300x300 in size. At this point, the exhaustive search is used to come up with a displacement on the smaller images. Then, the channel is displaced by the displacement in the higher resolution image to figure out an offset on the higher resolution image.

emir no bordermelons no borderonion church no border

Bells and Whistles

In order to crop the borders from the above images, a heuristic was used that checks the normalized value on the 3rd dimensions and if it is more than 0.88 or less than 0.12, it marks the pixel. If the number of marked pixels in a row or column is 85% or more than its length, the row/column is pruned. This method stops iterating as soon as the first row/column fails the test (to only crop the borders).

emir no bordermelons no borderonion church no border

This check fails for the following image because the sky is almost white and blends with the border, thus thinking of it as a border and pruning it.

emir no bordermelons no border

In order to fix the first picture above, instead of using the L2 norm on the RGB values, the picture was first passed through a Canny filter with the minimum and maximum threshold of 50 and 100 respectively. The filtered image with edges enhanced is used to align the images.

emir no bordermelons no border

Final Images

Fig. 1 - Castle (R: [97, 5], G: [34, 3]).
Fig. 2 - Cathedral (R: [12, 3], G: [5, 2]).
Fig. 3 - Emir (R: [107, 41], G: [49, 24]).
Fig. 4 - Harvesters (R: [124, 15], G: [60, 18]).
Fig. 5 - Icon (R: [90, 23], G: [41, 19]).
Fig. 6 - Lady (R: [112, 13], G: [53, 9]).
Fig. 7 - Melons (R: [177, 13], G: [81, 10]).
Fig. 8 - Monastery (R: [3, 2], G: [-3, 2]).
Fig. 9 - Onion Church (R: [107, 36], G: [50, 28]).
Fig. 10 - Self Portrait (R: [175, 37], G: [77, 29]).
Fig. 11 - Three Generations (R: [110, 9], G: [48, 14]).
Fig. 12 - Tobolsk (R: [6, 3], G: [3, 3]).
Fig. 13 - Train (R: [84, 33], G: [40, 8]).
Fig. 14 - Workshop (R: [105, -12], G: [53, -1]).

Prokudin-Gorskii collection