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.

Results
Images Aligned to Blue Channel
Aligned Image Green Shift Red Shift
cathedral (4, 2) (10, 2)
tobolsk (2, 4) (8, 2)
monastery (–2, 2) (2, 2)
harvesters (60, 16) (124, 12)
icon (40, 16) (88, 22)
lady (52, 8) (112, 12)
onion_church (52, 24) (108, 32)
three_generations (52, 12) (110, 10)
train (42, 2) (88, 32)
1 (36, 30) (292, –164)
2 (32, 8) (114, 12)
3 (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
emir (–48, –24) (56, 16)
melons (–82, –12) (94, –4)
self_portrait (–80, –30) (96, 8)
village (–64, –12) (72, 4)