CS 194-26 Project 1 - Michelle Chen

Overview

The goal of this project was to take digitized Prokudin-Gorskii glass plate images, extract out three gray-scale images from three differentcolor channels (R, G, B), place them on top of each other, and align them to produce a single colored image.

Approach

For smaller images I used both SSD and NCC to get a metric of the alignment. For both approaches, I searched through x and y displacement values of [-15:15] and chose the displacement value that produced the best metric (minimum for SSD, maximum for NCC). I found that both functions produced the same displacement values for x and y, but SSD took much less time to do so, so I used the SSD approach to produce the colorized images below. I also changed the displacement values from [-15:15] to [-25:25], since the results were much better, specifically for monastery.jpg and nativity.jpg.

For larger images, SSD would take too long, so I used the image pyramid approach to first downscale the image by a factor of 2 to the minimum size (the measurements of the smallest size were produced through trial and error), and then align the image at that level using SSD with displacement values of [-15:15]. Then I would recursivley upscale the image by 2, double the displacement values from the previous alignment, and search through displacement values of [-3:3] around the previously calculated displacement values.

Before doing the alignment process, I cropped off the borders of the original images to reduce the excess noise. I cropped off 20 pixels on the top, bottom, left, and right for small images (.jpg), 200 pixels for large images (.tif), and specifically for emir.tif, I cropped off 135 pixels (since after trial and error this value seemed to produce the most accurately aligned version).

Results

Small Images

cathedral.jpg
G = [2, -8] R = [3, -14]

monastery.jpg
G = [2, -16] R = [2, -23]

nativity.jpg
G = [1, -10] R = [0, -18]

settlers.jpg
G = [0, -6] R = [-1, -12]

Large Images

emir.tif
G = [24, -41] R = [31, -87]

harvesters.tif
G = [16, -73] R = [13, -141]

icon.tif
G = [17, -93] R = [23, -178]

lady.tif
G = [8, -75] R = [11, -158]

self_portrait.tif
G = [26, -57] R = [36, -90]

three_generations.tif
G = [14, -79] R = [10, -153]

train.tif
G = [5, -90] R = [32, -178]

turkmen.tif
G = [18, -78] R = [26, -152]

village.tif
G = [12, -68] R = [22, -128]

Self-selected Images

victoria.jpg
G = [1, -5] R = [0, -10]

entrance.tif
G = [-6, -75] R = [-18, -139]

icon_2.tif
G = [50, -72] R = [72, -124]

Difficulty in alignment

For emir.tif, I changed the amount cropped off the image from 200 to 135 because it provided a better looking image. However, it is still a little blurry. The reason is that the man's clothing is drastically different in color-intensity on the red and green channels, causing SSD alignment to perform poorly.

Bells and Whistles

To improve the quality of some of the images, I applied the Sobel edge detection filter to the image channels before computing the metric/displacement values. This worked better for emir.tif since we use edges as the parameter for our metric, rather than the image intensities, which differed drastically on the different channels. Sobel also improved the blurriness of lady.tif. However for train.tif, the image quality got worse, but that was quickly corrected by changing the amount cropped off from the border from 200 to 135 (same as emir.tif).

Images improved by the Sobel image filter

emir.tif
G = [24, -41] R = [31, -87]

emir.tif with sobel
G = [24, -41] R = [41, -75]

lady.tif
G = [8, -75] R = [11, -158]

lady.tif with sobel
G = [9, -76] R = [12, -146]