In this project, you'll automatically create color images from the black and white photographs of Sergei Mikhailovich Prokudin-Gorskii (1863-1944). The download directory contains scanned negatives of the Prokudin-Gorskii images from the Library of Congress.
You should write a single function that takes a grayscale Prokudin-Gorskii image as input, and returns a high quality RGB image as output. Your function should be completely automatic, i.e. it should require no help from the user! Note that the order of the color channels, from top to bottom, in the Prokudin-Gorskii images is BGR, not RGB.
Write a simple brute-force alignment algorithm that first splits the image into 3 parts. Use the G channel as the anchor channel, and find the best displacements for the R and B channels. Once you have the displacements, you can construct the RGB image by put them into corresponding color channels and display one the screen. How do you determine which is the best displacement? Use a simple image comparison metric such as the sum of squared difference (SSD) or the normalized cross correlation (NCC). NCC is the dot product between two normalized vectors. You may want to do normalization on small images blocks instead of the whole image. You also may want to exclude the border from the comparison. Consider using the demo code in our class for localizing objects as a basis for this project. The codes are available at the note section of the course web site (http://www.cs.bc.edu/~hjiang/cs374/notes.html).
You'll notice that if the matching kernel size D is large or if the images are large, then this solution is prohibitively slow: The time complexity is O(n*D^2), where n is the number of pixels in the image. Discuss possible ways to speed up the computation.
Show the aligned RGB image for each input image in the download directory. If you cannot align an image, explain why. Also, for each image, report the time your code took.
Submit your code and writeup electronically to the black board system. You do not need to hand in a printout.
The images and the idea for the project is from Alyosha Efros. This web page is modified from David Martin's 2009S course project.