template taken from HTML5 Webtemplates.co.uk

CS 194-26 Project 1

by Larry Zhou

Overview

We were given our first project based on the aspirations of Sergei Mikailovich Prokudin-Gorskii. By putting together his glass plate images that were provided by the Library of Congress, I was able to reproduce a color image using three color channel images. The metric I decided to use was the sum squared difference because it was more intuitive to me.


JPG images

The jpg images were relatively straightforward to colorize. While using the blue channel as a reference, we checked the green and red channels against it to find the best alignment.All it took iterating through a pixel displacement of [-15, 15] using a for loop to find the smallest SSD (sum of squared differences) in order to determine a good alignment.

JPG

R[0, -1], G[2, -1]
R[3, 2], G[-3, 1]
R[7, 1], G[3, 1]
R[14, -1], G[7, 0]

TIF images

The TIF images were much more difficult to work with due to the sizes of the r, g, and b matrices. Thus, in order to combat this, I used an image pyramid as suggested. I would continually scale a plate by half until the matrix that represented it had a length less than 200, while keeping track of the amount of times I scaled. I would then find the relatively best displacement by rolling the red and green matrices against the blue one by looking through displacements [-15, 15]. I would then recursively call the function and multiply the relatively best displacement by 2 and search between displacements [x-3, x+3] and [y-3, y+3] in the image that was twice the scale as the previous one, and continually do it until the scale reached the original size.

R[18, 17], G[45, 9]

R[123, 8], G[58, 11]

R[89, 22], G[40, 16]

R[114, -16], G[43, -6]

R[173, -3], G[76, -1]

R[111, 8], G[52, 6]

R[91, 3], G[41, -2]

R[114, 4], G[55, 6]

R[135, -15], G[62, -7]

A few additional images I grabbed from the Library of Congress website are below

Windmills R[125, 21], G[55, 10]

Melon Vendor R[178, 8], G[81, 4]

Tea Station R[104, -14], G[52, -4]

Failures

My algorithm failed to align the emir image. I believe that it had to do with the sharp contrast between the red channel and blue channel, thus causing the image to not align correctly. My algorithm also worked better on the cathedral when I didn't cut off 5% of the borders. Typically, if colors that were next to eachother differed drastically and were distinct, the colored image would end up better. For better results, playing around with the borders or increasing the range of the exhaustive search could have helped. Below is an example of what happened when I didn't crop 5% of the image off to remove the borders.