We are given three Black and White photos, each taken with a given filter(R,G,B). We aligned and combined these filtered images to create one color image. So my challenge was to find the best alignment for the three photos.
I found the best alignment by doing a row by row NCC comparison to find the best alignments. We rotated the matricies little by little testing the NCC each time to find the best alignment.
I found two problems. One, I taking a long time on larger tiff images. Rolling around massive images took a long time. My solution: I made an image pyramid. I downscaled the image and fit the filtered images on the smaller images. Then I scaled the rotations up as I scaled the images up. Importantly, as I scaled the images up I reduced the window I searched over. At higher levels if made the window too large the algorithm would overcorrect and the image would become blurry. Two, even after my alignment algorithm finished many of the images were still out of focus. My solution: I trimmed the borders by a fixed amount to ensure my algorithm focused on the meat of the image. This worked well
Cathedral
Red (12, 3) Green (5,2)
Monastery
Red (3, 2) Green (-3, 2)
Nativity
Red (8, 0) Green (3, 1)
Settlers
Red (14, -1) Green (7, 0)
Train
Red (96, 32) Green (48, 0)
Turkmen
Red (112, 32) Green (48, 16)
Village
Red (144, 1) Green (64, 1)
Emir
Emir didn't align properly; I think due to varying brightnesses acroess the different(RGB) images. I tried normalizing the source img. matricies but that didn't wind up working.
Red (112, -213) Green (48, 22)
Harvesters
Red (128, 16) Green (64, 16)
Icon
Red (96, 16) Green (48, 16)
Lady
Red (112, 11) Green (48, 6)
Self Portrait
Red (176, 32) Green (80, 32)
Three Generations
Red (112, 16) Green (48, 16)
Church Gates
Red (96, 32) Green (16, 16)
Imperial Gates
Red (22, 0) Green (-21, 16)
Mother Church
Red (160, 16) Green (64, 16)
Unfortunately Emir didn't align properly; I think due to varying brightnesses acroess the different(RGB) images. I tried normalizing the source img. matricies but that didn't wind up working. This project was a ton of fun! I really enjoyed taking theory and seeing tangible results