For this project the task was to find and algorithm that automatically aligns the three black and white RGB channels, taken by Sergei Mikhailovich Prokudin-Gorskii, to produce color photographs.
My algorithm works in the folowing way:
- Divide the original three channel photograph in three equal parts and use each part as one channel of the color image.
- Move the red channel over the blue channel one pixel in one direction
- Crop the borders of the picture (5% of the picture width)
- Calculate the Sum of Squared Differences between the red and blue channels
- Repeat the last 3 steps for all directions in a window of displacements provided by the user (usually 15 pixels for the small images and 120 for the large ones)
- Choose the displacement with the minimum SSD
- Do the same for the green channel
For the large images, I implemented an image pyramide for faster processing.