In this project, we were asked to reconstruct color images from black and white images taken with red, green, and blue filters. The idea was simple: since the brightness of pixels in one fixed area of an image generally (key word-- generally) correlates between color channels, a cross correlation calcuation over a sliding window of displacements gives enough information to align one filtered image with another.
I used Normalized Cross Correlation to find the best alignment in all my images and implemented the image pyramid speedup described in the spec to align the larger images. The dark borders around the edges of each image negatively affected the alignment, so I cropped a predfined border of 25% of the image internally in my alignment function. This allowed the alignment to be calculated only on the center of the image, which solved the border issue.
I made the choice to align the red and blue plates to the green plate instead of the project spec's suggestion to align to the blue plate because I found that this change made dramatic improvements to the Emir photo and, to a lesser degree, removed artifacts in the Monastery photo. I think that both of these photos had issues with the original setup because of the dominance of the blues in both photos, causing incorrect alignments to be chosen as the best alignment.
Below is the result of the NCC algorithm with the image pyramid speedup on the example images. Offsets for the red and blue glass plates are listed below the images.
Cathedral -- R: [7, 1], B: [-5 -2] Emir -- R: [57, 17], B: [-49, -24]
Harvesters -- R: [65, -3], B: [-59, -17] Icon -- R:[48, 5], B: [-40, -17]
Lady -- R:[61, 3], B: [-49, -8] Monastery -- R:[6, 1], B: [3, -2]
Nativity -- R:[4, -1], B: [-3, -1] Self Portrait -- R:[98 ,8], B: [-78, -29]
Settlers -- R:[8, -1], B: [-7, 0] Three Generations -- R:[59, -3], B: [-50, -14]
Train -- R:[43, 26], B: [-42, -6] Turkmen -- R:[560, 7], B: [-55, -20]
Village -- R:[73, 10], B: [-64, -12]