Images of the Russian Empire: Colorizing the Prokudin Gorskii Collection

Aaron Hsu

Code

Given 3 separate shifted image channels of colors from the same image, we were asked to align the coloring of these 3 images to produce one colored image. We were given jpg and tif files, where the tif files were much larger in size and precise. To handle aligning the images, I basically just used SSD to figure out the differences between images. While, I also tried using NCC, it came down to not much impressive results (about the same as SSD) and ended up taking much longer. As a result, SSD was simply used instead. Especially for the tif images, we needed to use gaussian pyramids to slowly and steadily align the images from the coarsest images all the way to the finest ones. The gaussian pyramids were created by proper gaussian blurring and sub-sampling (not using imresize). The multi-scaling has 4 levels. We have an original sized level, a half, a quarter, and an eighth. Also, to get better results, I took out the white and dark borders in each image. The white borders were taken out by averaging columns and rows and thresholded so that the white borders would be removed. As for the dark borders, it was difficult to find exact measurements of where to take out borders so as a result, I hard-coded the value so that it would remove a sufficient part of the dark bordering.

Results with [x,y] offset alignments

JPG's

The example smaller jpg's, aligned, are shown here.

A lot of images are not very close at all mainly because of how I'm doing SSD. I believe that a big portion of the errors are from not removing the dark borders around images (like what I tried to do in the tif files) Because of not removing, the dark borders greatly affects how the SSD calculates closeness and most likely skews the values.

some TIF's

The SSD is not perfect in each level as we don't accurately remove the dark borders in each channel images. We kind of just approximate it. Because at each level, the aligning isn't perfect - in the end the images may be just a little off. Sometimes at each level, it requires a larger search range to shift but because of how I implemented it, we only have a limited searching range at each level for time-running purposes & efficiency.