CS194-26 Project 1

John Son

Intro

Back before the invention of color photography, Sergei Mikhailovich Prokudin-Groskii took pictures of the Russian Empire through a green, red and blue filter, in hopes that one day technology would be created for these images to be viewed in color.

Implementation

1) Crop the image into thirds, separating out the image into the picture at each filter.
2) Align red filtered image to the blue filtered image as well as the green filtered image onto the blue filtered image
2a) Implement a image pyramid that rescales the image down to a certain size, find the best translations within a certain range, then rescale the image back up x2, and apply this best translation x2 and repeat until we reach the original image
2b) Use a non-convultional correlation (NCC) metric, which is basically the dot product of two noramlized images, to determine which translation is the best
3) Stack the aligned red filtered and green filtered images on top of the blue image to create similar to what the original picture should have looked like in color.

Problems

- Sometimes I would notice that my image was not aligning properly even though my calcuations were correct and I realized that I should not compare the borders of the images when calculating NCC to only compare the important innards of the image
- Figuring out to what scale I should initially scale my image down to when creating the image pyramid was also a hurdel I had to face, as scaling too small would cause insignificant details of the image to be compared, leading to a suboptimal alignment
- Some images, the saturation for one color was too strong so it was hard to align to a certain filter (such as emir and train) which caused some suboptimal alignment as well

Images (cropped and aligned)

cathedral g(-2, -5), r(1, 7)
monastery g(-2, 3), r(1, 6)
nativity g(-1, -3), r(-1, 4)
settlers g(0, -7), r(-1, 8)
emir g(-10, -116), r(-18, -102)
harvesters g(16, 60), r(14, 124)
icon g(17, 40), r(23, 89)
lady g(8, 55), r(-6, 113)
self_portrait g(29, 79), r(34, 175)
three_generations g(13, 55), r(10, 112)
train g(6, -112), r(16, 80)
turkmen g(16, 56), r(14, 114)
villagers g(6, -104), r(12, -116)
fishing g(0, 0), r(-6, 12)
fancy door g(0, 0), r(0, 10)
cemetary g(0, 6), r(0, 12)