Project 1 - CS 194-26 - Eric Tang

church

Project Overview

In this project, we aimed to take digitized Prokudin-Gorskii glass plate images, and use them to produce quality color images by aligning the three channel images on top of each other to create a single RGB color image. We aimed to optimize the performance of this algorithm using image pyramids on top of a naive exhaustive search algorithm.

My Approach

For implementing single scale exhaustive search, I used the SSD (Sum of Squared Differences) as the metric for aligning the images to one another. I found that this worked well on the smaller jpg images, so I stuck with it throughout the rest of the project. I searched over a radius of (-20,20) in both the x and y directions, and used np.roll to change the shape of images. Below are the jpg images aligned using Exhaustive Search.

image image church

Multiscale Pyramid Implementation

For the larger tiff encoded images, I implemented an image pyramid in order to calculate larger offsets for images more efficiently. I rescaled images repeatedly to half of their current width and height, and set search depth for images to 5. At the lowest resolution image, I started with a search radius of 32, and then repeatedly halved the search radius as resolution increased, giving the full resolution image a search radius of just 2. Additionally, I set cropped the borders of all images by 0.1 of the height and width of the image on all sides. I also aligned the images on top of the green plate, as this produced the most consistent results across all example images (for aligning on top of blue, cathedral.jpg runs into issues).

Images and Offsets

Example Images

image image church church church church church church church church church church church church

Additional Images

church church church

Calculated Image Offsets

Image Name Blue Shift Red Shift
cathedral.jpg (2, 5) (-1, -7)
church.tif (4, 25) (8, -33)
emir.tif (24,49) (-17,-57)
harvesters.tif (16, 59) (3, -65)
icon.tif (17, 41) (-5, -48)
lady.tif (8, 56) (-3, -62)
melons.tif (11, 82) (-4, -96)
monastery.jpg (2, -3) (-1, -6)
onion_church.tif (27, 51) (-10, -57)
self_portrait.tif (29, 79) (-8, -98)
three_generations.tif (14, 53) (3, -58)
tobolsk.jpg (3, 3) (-1, -4)
train.tif (6, 43) (-27, -43)
workshop.tif (0, 53) (11, -52)