Project Overview:
In this project, we tackle the problem of colorizing the Prokudin-Gorskii collection. Sergei Prokudin-Gorskii realized a method of taking color photographs even before colored photos were possible to manufacture. He took three pictures of the same image, each with a different glass plate filter -- one in red, blue, and green. Then, theoretically, one could combine the three color channels together to produce the fully colored image. Unfortunately, Prokudin-Gorskii did not get to see his work come to fruition, but in this project, we get a chance to colorize the images like he envisioned.
Project Approach:
In order to colorize each image, I align the red and blue channels to the green channel. I chose green to be the base for similar reasons as the Bayer filter uses twice as many green squares than blue or red. Furthermore, when aligning the images I am only concerned with the inner portions of the image. That is where the main subjects likely are and when a human looks at a photo, he will focus his attention on the center anyway. Therefore, it is more crucial to get the middle correct. This also allows me to save time by cutting down the necessary computations. Originally I used blue as the base. With this method, I ran into issues aligning emir.tif, since his overcoat is blue. Therefore, the pixels on the coat were very high for the blue plate, but very low for the red plate. Since I penalize difference in pixel brightness, I was getting terrible results for aligning red to blue. Since most blues in our world are also, to some degree, green, switching the base to green remedied the situation.
Furthermore, for large images, it is inefficient to search thoroughly for the best alignment. Therefore, I used a pyramid scheme to determine a good alignment. I zoom in the image by 2x repeatedly, collecting my pyramid of images until it is within 300x300 pixels (very low resolution). Then starting from low resolution and working my way up, I determine the best alignment within a window of 15 pixels. Using that best shift, I start my search for the next image from that same point. I repeat this process until I have found the shift for my original image.