CS194-26: Image Manipulation and Computational Photography, Fall 2017

Project 1: Colorizing the Prokudin-Gorskii photo collection

Jeffrey Wang, CS194-26-acl

Overview

The overall project seeks to align images taken in the R,G,B planes in order to create a colorized image as a result. For my approach, I first naively aligned the images which led to very misaligned images, before implementing a single-scale solution that would compute the SSD over the image over a window of 10% the size of the original image. In order to improve the speed in which I performed alignments, I implemented an image pyramid, along with doing it over a smaller window to improve the overall image alignment accuracy. Some images I ran into problems with still with the image pyramid were `emir.tif` and `boat.tif`, although reducing the cropped image to check windows did seem to help `boat.tif`. After that I applied a few Bells and Whistles to see if I could improve my results





Naive vs. Sum of Square Differences

I started off with naive alignments just to see how things looked with a naive alignment. I then applied SSD as a metric for aligning the glass plates, and limited the displacement to [-min(width, height)/10, min(width,height)/10]. I also implemented NCC, although it seemed to take a lot longer and seemed to have similar results. The displacement window didn't work well with the .tif images, so I noted that and made that change for the image pyramid.

Naive Approach
SSD Displacement: red: (8, 3) green: (1, 2)
Naive Approach
SSD Displacement: red: (3, 2) green: (-3, 2)
Naive Approach
SSD Displacement: red: (8, 0) green: (3, 1)
Naive Approach
SSD Displacement: red: (15, -1) green: (7, 0)


Pyramid

To improve efficiency, I used an image pyramid. I calculated scale to log2 of the minimum dimension to calculate how many times to resize the pyramid, and scaled by 0.5 every time. This way you could work with a smaller displacement (I chose log10), at different scales to reduce the window that you need to calculate over.

red: (144, 79) green: (41, 38) time: 10.56s
red: (8, 3) green: (1, 2) time: 0.34s
red: (127, 13) green: (61, 16) time: 9.76s
red: (97, 23) green: (42, 17) time: 8.58s
red: (122, 11) green: (55, 8) time: 11.51s
red: (177, 36) green: (80, 29) time: 11.93s
red: (113, 11) green: (55, 14) time: 7.4s
red: (104, 12) green: (28, 5) time: 7.76
red: (92, 32) green: (45, 6) time: 12.06s
red: (117, 27) green: (57, 21) time: 9.34s
red: (155, 45) green: (71, 24) time: 10.49s
red: (105, 43) green: (45, 23) time: 11.12


Examples of Alignment Going Wrong

SSD and NCC are both functions that calculate over the intensity values, and because of that, it can be hard to score across the RGB planes, as one plane might have very different intensities from another (especially in the case that it is more Red, Green, or Blue). This happened for me on Emir's image and the village.

red: (114, -203) green: (48, 24) time: 10.56s

Emir's robe in the picture is very blue, as you can see by the B+G overlay. This would mean that on the Red plane, his robe intensity wouldn't be captured the same, and can be seen in the original glass plates. This leads to the Red plane not aligning properly.

red: (138, 23) green: (19, -13s) time: 9.24s

The fields on this image don't line up, just like these HTML tables don't match up because they aren't cooperating with me. The actual image is very green, so the intensities on the glass plates differ significantly, affecting the resulting images