CS194-26: Images of the Russian Empire

Colorizing the Prokudin-Gorskii photo collection

Olivia Koshy | cs194-26-afs

Project Summary

This project uses image processing techniques to produce color image outputs from Prokudin-Gorskii glass plate images.

Method

For small jpeg images I had a "naive" algorithm. This algorithm would compute a center patch of one image, and slide a smaller patch of the other image and compute the NCC value. Our goal was to maximize the NCC value which shows us that the two patches have the highest correlation. I originally used SSD and aimed to minimize the error although this was not an ideal approach because it doesn't take into account the large difference in rgb values.

For larger images we don't want to follow the "naive" algorithm as it would take forever to compute for lare patches, and wouldn't be effective if we had smaller patches. Therefore I downsampled the image until it was similiar in size to our small iamges (~300x300) and found the best patch. From there we scaled back up the image, and using the "best" patch we found, realigned to find the new best patch within the previous patch. That way on each upsampled patch, we were looking at a much smaller patch than we would have if we had implemented it using the naive method.

Challenges

A big challenge I had was being able to correctly upscale the images and keeping track of the coordinates to relocate. When we were finding the amount to roll, it was much easier since we only had to keep track of the offset compared to a relative patch size. Although when we are scaling up the images we want to keep track of the coordinates relative to the entire image. I found this to be a bit more difficult. My solution was to keep track of the coordinates of the top left patch, and once finding the offset, add the offset to the top left coordinates such that I could always keep track of the "best" x, y values of a patch as coordinates relative to the entire image. Then everytime I scaled an image up by 2x, I was able to just scale my best x, y coordinates by 2 and know exactly where my new "best patch" started.

Example Images

Cathedral: Red (1,7) | Blue (-2, -5)

Emir: Red (1, 48) | Blue (-32,-39)

Harvesters: Red (0,63) | Blue (-21,-59)

Icon: Red (6,49) | Blue (5,-57)

Lady: Red (5,56) | Blue (-8,-47)

Monastery: Red (1,6) | Blue (-2,3)

Nativity: Red (-1,5) | Blue (-1,-3)

Self_Portrait: Red (0,96) | Blue (-32,-80)

Settlers: Red (-1,8) | Blue (0,-7)

Three_Generations: Red (0,66) | Blue (-16,-51)

Train: Red (26,44) | Blue (-6,-42)

Turkmen: Red (11, 58) | Blue (-22,-57)

Village: Red (10,72) | Blue (-13,-64)

Extra Test Images

Extra_1: Red (-1,7) | Blue (1, -1)

Extra_2: Red (0,4) | Blue (-1,-1)

Extra_3: Red (-1,6) | Blue (-1,-6)