CS 194-26: Project 1: Images of the Russian Empire

Overview

In this project, we attempted to colorize photos. A Russian man once traveled along the Russian empire to take photos. He took three exposures of every scene onto a glass using a red, green, and blue filter. The goal of this project was to align these three exposures in order to produced the color version of these three exposures! Exciting!

Explanation

The images do not line up properly in the x and y directions, so we attempt to shift the red and green exposures in order to match the blue exposure. An easy way of doing this is searching every pixel displacement within a certain window and picking the displacement that leads to the smallest L2 norm between the images. For larger images, we implemented an image pyramid. We kept resizing the image to half of its original size, finding the best displacement in the smaller image, and then searching within a smaller range of displacements for the next image up.

I also cropped the image around the border before searching for the best displacement.

Failures

Two of the images did not turn out very well, emir and village. This is likely because the brightness values do not actually match from channel to channel, so the L2 norm may not be the best metric to compare which images are aligned.

Required Example Images (jpgs)

cathedral.jpg; Green offset: (5, 2); Red offset: (12, 3)



monastery.jpg; Green offset: (-3, 2); Red offset: (3, 2)



tobolsk.jpg; Green offset: (3, 3); Red offset: (6, 3)

Required Example Images (tifs)

emir.tif; Green offset: (49, 23); Red offset: (52, 44)



harvesters.tif; Green offset: (60, 16); Red offset: (120, 13)



icon.tif; Green offset: (40, 17); Red offset: (89, 23)



lady.tif; Green offset: (55, 8); Red offset: (134, 3)



melons.tif; Green offset: (82, 8); Red offset: (178, 12)



onion_church.tif; Green offset: (52, 26); Red offset: (108, 36)



self_portrait.tif; Green offset: (80, 28); Red offset: (175, 36)



three_generations.tif; Green offset: (54, 11); Red offset: (111, 9)



train.tif; Green offset: (43, 5); Red offset: (87, 31)



village.tif; Green offset: (65, 12); Red offset: (90, 25)



workshop.tif; Green offset: (53, 0); Red offset: (101, -12)

Extra Examples

doggo.jpg; Green offset: (1, 0); Red offset: (8, 0)



mural.jpg; Green offset: (5, 1); Red offset: (11, 2)



river.jpg; Green offset: (3, 1); Red offset: (6, 1)