CS194-26 Project 1

Bryan Yang
3032715337

Overview

The goal of this project is to take a glass plate image and reconstruct it as a colorized image.

Approach

I decided to implement the Sum of Squared Differences method, and tested it on both the .jpg and the .tif images.
The .tif images took significantly longer than the .jpg to process, and results varied. Some, like tobolsk, came out fine, whereas others, like self_portrait, did not align properly.
I then added the pyramid speedup as well user input for pyramid level and scale, and ran the colorizer on all the images at various pyramid level counts and scales. I started to see better results overall, but some, particularly harvesters, emir, and train still had very noticable alignment issues.
Next, I manually added cropping, cropping off 10 pixels per side for .jpg and 100 pixels per side for .tif. This only saw some improvement in alignment, and the errors were still very noticable.
Increasing the cropping on .tif images to 150 on each side drastically reduced the blurring on emir, harvesters, self_portrait, and train. The black borders significantly affected the aligning of some of the images, therefore removing them improved the alignment quality.
For some images like train, 6 pyramid levels at scale 0.5 and 150 cropped off each side yielded better results than the same level.scale with no cropping or 10 pyramid levels at scale 0.75 and 150 cropped off each side

Examples

Offset given in (axis0, axis1)
10 level images slightly shrunken to meet size limitations.

6 levels, 0.5 scale, No Cropping

10 levels, 0.75 scale, Crop 10(jpg), 150(tif)

castle6nc
castle - level 6 scale 0.5 no crop; green offset (36, 3) red offset (97, 5)
castle10
castle - level 10 scale 0.75 crop 150; green offset (-65, 0) red offset (-102, 0)
cathedral6nc
cathedral - level 6 scale 0.5 no crop; green offset (-340, -1533) red offset (-333, -1924)
cathedral10
cathedral - level 10 scale 0.75 crop 10; green offset (-5, 0) red offset (-6, 0)
emir6
emir - level 6 scale 0.5 no crop; green offset (-3, 7) red offset (107, 17)
emir10
emir - level 10 scale 0.75 crop 150; green offset (-51, 2) red offset (-97, 2)
harvesters6nc
harvesters - level 6 scale 0.5 no crop; green offset (118, -3) red offset (95, -1)
harvesters10
harvesters - level 10 scale 0.75 crop 150; green offset (-41, 1) red offset (-78, 1)
icon6nc
icon - level 6 scale 0.5 no crop; green offset (42, 16) red offset (89, 22)
icon10
icon - level 10 scale 0.75 crop 150; green offset (-58, 1) red offset (-107, 2)
lady6nc
lady - level 6 scale 0.5 no crop; green offset (57, -6) red offset (123, -17)
lady10
lady - level 10 scale 0.75 crop 150; green offset (-46, 0) red offset (-96, 0)
melons6nc
melons - level 6 scale 0.5 no crop; green offset (83, 4) red offset (176, 7)
melons10
melons - level 10 scale 0.75 crop 150; green offset (-16, 0) red offset (-22, 1)
monastery6nc
monastery - level 6 scale 0.5 no crop; green offset (-346, -2327) red offset (-331, -1934)
monastery10
monastery - level 10 scale 0.75 crop 10; green offset (-10, 0) red offset (-11, 0)
onion_church6nc
onion_church - level 6 scale 0.5 no crop; green offset (52, 22) red offset (108, 0)
onion_church10
onion_church - level 10 scale 0.75 crop 150; green offset (-48, 2) red offset (-92, 29)
self_portrait6nc
self_portrait - level 6 scale 0.5 no crop; green offset (50, -2) red offset (130, -5)
self_portrait10
self_portrait - level 10 scale 0.75 crop 150; green offset (-45, -1) red offset (-39, 0)
three_generations6nc
three_generations - level 6 scale 0.5 no crop; green offset (52, 5) red offset (108, 7)
three_generations10
three_generations - level 10 scale 0.75 crop 150; green offset (-44, 1) red offset (-89, 1)
tobolsk6nc
tobolsk - level 6 scale 0.5 no crop; green offset (-343, -1609) red offset (-340, -1608)
tobolsk10
tobolsk - level 10 scale 0.75 crop 10; green offset (-5, 0) red offset (-8, 0)
train6nc
train - level 6 scale 0.5 no crop; green offset (111, -7) red offset (107, 1)
train10
train - level 10 scale 0.75 crop 150; green offset (-57, 0) red offset (-108, 2)
workshop6nc
workshop - level 6 scale 0.5 no crop; green offset (53, -5) red offset (69, -16)
workshop10
workshop - level 10 scale 0.75 crop 150; green offset (-47, -1) red offset (-100, -13)

Self-picked

All of the following images colorized with 6 levels, 0.5 scale, and 150 pixels cropped off each side.
houses
Houses
sailors
Sailors