CS 194-26 Project 1

My approach...

First, I cropped the image into three: r, g, b pictures. Next, I used SSD to determine the x and y offsets that reduced the SSD which measures difference between pixel values. If the image was large, I used an image pyramid, scaling by 2, to more efficiently find the optimal offsets

Problems I encountered and how I solved them...

I encountered problems with general bugs in my loops and logic, in particular for the image pyramid implementation. I fixed these bugs with help from another pair of eyes, and from simply looking at it over and over, and trying different logic combinations. Also, I was having trouble aligning certain images because I did not realize there were some that simply would never look perfect.

Results:

Example Images:

Offsets:

cathedral

Offsets:

monastery

Offsets:

tobolsk

Offsets:

emir

Offsets:

harvesters

Offsets:

icon

Offsets:

lady

Offsets:

melons

Offsets:

onion church

Offsets:

self-portrait

Offsets:

three generations

Offsets:

train

Offsets:

village

Offsets:

workshop

Images of Choice:

Offsets:

apricot

Offsets:

flower_trees

Offsets:

saints

Failure to align? why?

I had failure to align on multiple photos. The only explanation can be human error.
  1. The subjects might have moved in between photos. This is particularly likely to be a reason for failure to align. Lady.tif had very good alignment because most likely the lady in the photo is a model, whereas emir.tif did not align because Emir was not staying still.
  2. The photographer might have moved the camera slightly between photos.

Note: if I had employed a more sophisticated such as edge detection, I would have been able to align these photos much better. However, I have worked for more than 7 hours on this 5 hour project, so I am done.

Bells and Whistles:

N/A