CS194–26 Project 1
Sohan Subhash cs194–26-afh
Overview
I was tasked to write a program that will align the different color-filtered slides form the Prokudin-Gorskii Photo Collection.
Single Scale
I first wrote a simple alignment function that looped over every pixel in the image to calculate the minimum SSD between blue and green, blue and red. I used the displacement range of [–15,15].
I found that SSD was simpler to implement than NCC and provided similar results
Multi Scale (Pyramid)
I had to change my function for larger resolution images. I first calculated the number of times I would have to scale the image by half until it was smaller than 64x64. At each scaled level I calculated the displacement by using SSD.
For each time I scaled the image up, I doubled the displacement, and I reduced the range that SSD checked.
Images Aligned to Blue Channel | ||
---|---|---|
Aligned Image | Green Shift | Red Shift |
(4, 2) | (10, 2) | |
(2, 4) | (8, 2) | |
(–2, 2) | (2, 2) | |
(60, 16) | (124, 12) | |
(40, 16) | (88, 22) | |
(52, 8) | (112, 12) | |
(52, 24) | (108, 32) | |
(52, 12) | (110, 10) | |
(42, 2) | (88, 32) | |
(36, 30) | (292, –164) | |
(32, 8) | (114, 12) | |
(12, –8) | (132, –14) |
My program had some issues with some of the sample images provided. I noticed that when I aligned these images to Green Channel instead of the Blue one that my program was able to succeed. I think that this worked because these images have a significant difference in their brightness values for each channel. Aligning everything to Blue would result in SSD calculations not representative of the image.
Images Aligned to Green Channel | ||
---|---|---|
Aligned Image | Blue Shift | Red Shift |
(–48, –24) | (56, 16) | |
(–82, –12) | (94, –4) | |
(–80, –30) | (96, 8) | |
(–64, –12) | (72, 4) |