CS 194-26: Image Manipulation and Computational Photography

Project 1: Images of the Russian Empire

Justin Lu - 26306214

Abstract

In this project, I colorized a set of images by combining glass plates that represent the red, blue, and green channels of the image. This was accomplished by properly aligning these channels by shifting them by some calculated displacement. For a given scale, we find the optimal displacement by searching through a window of displacements (-15 to 15 in both the x and y axes) and finding the smallest difference between the channels by using the L2 norm. For larger images, we use an image pyramid to improve efficiency when calculating the final displacement. We start at a low resolution image (1/8th of the original), calculate the optimal displacement of that image, and then repeat the process at 2x resolution of the previous only searching in a small window around the previous displacement.

When I originally implemented my algorithm, even though I had ensured that all my calculations were correct, my images still were not aligned properly. I fixed this by removing the borders of the image before finding the optimal displacement, since borders often did not reflect the rest of the image. This involved cropping 10% of the image from each side before performing any calculations. Even after this, however, there was still some misalignment in my final images. I was able to fix this by instead aligning the red channel with the green channel, instead of the blue channel in the original starter code that had been provided.

Below are the final results after alignment. Each tuple represents an offset with the first value being the offset in the x-axis and the second value being the offset in the y-axis. The first tuple in the offset represents the displacement of the green channel to get it to align with the blue, and the second tuple represents the displacement of the red channel to get it to align with the green channel.

cathedral.jpg - offset: (0, 0), (0, 8)
monastery.jpg - offset: (0, -4), (0, 0)
nativity.jpg - offset: (0, 4), (0, 8)
settlers.jpg - offset: (0, 8), (0, 16)

emir.tif - offset: (24, 48), (40, 104)

harvesters.tif - offset: (16, 60), (12, 124)

icon.tif - offset: (16, 40), (20, 88)

lady.tif - offset: (8, 52), (12, 112)

self_portrait.tif - offset: (28, 80), (36, 168)

three_generations.tif - offset: (12, 52), (8, 112)

train.tif - offset: (4, 44), (32, 88)

turkmen.tif - offset: (20, 56), (28, 116)

village.tif - offset: (12, 64), (24, 136)

Below are images I selected from the Prokudin-Gorskii collection.

boats.tif - offset: (44, 24), (60, 128)

factory.tif - offset: (12, 52), (16, 104)

melon.tif - offset: (8, 80), (12, 168)

pinkhus.tif - offset: (-24, 52), (-56, 108)

railway.tif - offset: (-8, 12), (4, 68)

windmills.tif - offset: (16, 56), (24, 124)