Project 1: Colorizing the Prokudin-Gorskii photo collection
The Prokudin-Goskii collection is a series of photos taken by Sergei Mikhailovich Prokudin-Gorskii of the Russian Empire in an effort to be the first to document this in color photography. He did this by taking three photos of each scene, each through either a red, blue, or green color filter. Sadly, he never got to see his photos in color :( Our goal for this project was to use the magic of computers to align the three channels of these photos to create the colored photo of Prokudin-Gorskii's dreams. Here's how I did it.
First, I trim the borders of each channel and compare the inner portions of the channels to each other. Within a displacement window of -15 to 15 for the x and y axis, I compare the displaced channel with a fixed green image using sum of squared differences. Whichever displacement results in the lowest SSD is what I will use for the alignment. Once I've done this calculation, I apply the displacement on the original channel images. Finally, I will crop off the channels that are "hanging off" so that only the portion where all three channels are overlapping will be stacked to recreate the color image. To speed up the processing of the higher resolution images, I added a coarse-to-fine pyramid processing, by finding the displacement on zoomed in versions of the images and using that to narrow the scope of search as I try to align higher and higher resolution versions. I chose to align to the green channel, so displacements (x, y) are relative to the green image.
blue: (-2, -5), red: (1, 7)
blue: (-24, -49), red: (17, 57)
blue: (-17, -41), red: (-3, 65)
blue: (-17, -41), red: (5, 48)
blue: (-9, -55), red: (4, 62)
blue: (-2, 3), red: (1, 6)
blue: (-1, -3), red: (-1, 4)
blue: (-29, -79), red: (8, 98)
blue: (0, -7), red: (-1, 8)
blue: (-14, -53), red: (-3, 59)
blue: (-6, -43), red: (27, 43)
blue: (-21, -56), red: (7, 60)
blue: (-12, -65), red: (10, 73)
Extra images downloaded and aligned from the collection:
blue: (-1, -1), red: (1, 2)
blue: (-1, -1), red: (-1, 3)
blue: (-2, -2), red: (1, 7)
blue: (-1, 6), red: (0, 10)