CS 194 Project 1

Overview

I built off the Python starter code, which already extracted the different color channel images and stacked them. I implemented a basic SSD alignment function using various numpy functions, then extended that to implement the pyramid image processing algorithm by adding recursion. To process all images easily, I added a few global variables to track attributes, and wrapped all the per-image logic in a function called "colorize".

Issues

cathedral.jpg in particular gave me some problems. I use a naive SSD implementation as a metric to score images along with aligning onto blue. For some reason, this worked extremely well on all images except cathedral.jpg. I tried some odd hotfixes: trying to align the red/blue channel images onto the green produced poor results for most images (but did fix the issue for cathedral.jpg). After further debugging, I realized that cropping was causing the issue; it was an unfortunate crop factor + initial window selection). Changing the crop factor to 1/15 fixed the issue completely.

Failures

My algorithm completely failed to align emir.tif. I believe this is due to the use of the naive metric, pixel value, when judging an alignment in the SSD alignment code. As mentioned in the project spec, the images to be matched do not have the same brightness values, so the naive metric is not good enough. However, the algorithm worked well on every other input, so I was ultimately satisfied with the results of the algorithm.

Results

I chose three example images: lake.jpg, adobe.tif, and cherry-tree.tif from the online collection.

cathedral.jpg

monastery.jpg

tobolsk.jpg

lake.jpg

adobe.tif

cherry-tree.tif

emir.tif

harvesters.tif

icon.tif

lady.tif

melons.tif

onion_church.tif

self_portrait.tif

three_generations.tif

train.tif

village.tif

workshop.tif

Details

Please see results-final.txt for per-image offsets and runtimes.