CS194-26: Image Manipulation and Computational Photography, Fall 2018

Project 1: Images of the Russian Empire

Karthik Kadalabalu Matha, CS194-26-agl



Overview

For this project, the goal was to take the digitized Prokudin-Gorskii glass plate images and using image processing techniques, automatically produce a color image with as few visual artifacts as possible. To achieve this, we needed to extract the three color channel images, place them on top of each other, and align them so that they form a single RGB color image.

Section I: Implementation

Part 1: Single-Scale

The method used to align the images is to compare the R, G, and B channels to find matches in pixel intensity. I used the G and R channels to compare against the B channel respectively in some x, y displacement. I chose to use a [-15, 15] pixel window (left, right, up, and down). The alignment algorithm I used was Sum of Squared Differences (SSD):

ssd = sum( sum( (image1 - image2) ^ 2 ) )

With this metric, the alignment is better, the smaller the value is, so I took the minimum of the ssd values within the exhaustive search and used its corresponding displacement as the value on which to align the channels.


Cathedral Green: (5, 2), Red: (12, 3)
Monastery Green: (-3, 2), Red: (3, 2)
Nativity Green: (3, 1), Red: (7, 0)
Settlers Green: (7, 0), Red: (14, -1)

Part 2: Multi-Scale

Using the exhaustive search method will become increasingly computationally expensive if the pixel displacement is too large (which will be the case for higher-resolution glass plate scans). For this case, I implemented a faster search procedure, known as image pyramid which is done starting from the coarsest scale to the finest scale, updating the displacement as the algorithm proceeds. This was achieved fairly simply by taking the single-scale implementation and adding recursive calls to it.



Harvesters Green: (59, 19), Red: (123, 18)
Icon Green: (40, 18), Red: (89, 24)
Lady Green: (48, 7), Red: (108, 11)
Self Portrait Green: (77, 29), Red: (175, 37)
Three Generations Green: (49, 15), Red: (108, 12)
Train Green: (42, 6), Red: (85, 32)
Turkmen Green: (56, 22), Red: (117, 29)
Village Green: (64, 13), Red: (136, 23)

Section II: Bells and Whistles

Edge Detection

Edge detection does a comparison between the changes in intensities and there are many approaches, but the one that I used for this was the Sobel edge detection from sci-kit image. For images such as Emir, this was a good approach to take rather than the mere pixel intensity comparison because there were varying levels of brightness that caused the alignments to not sit as intended with SSD and NCC metrics.


Before
After Green: (48, 23), Red: (106, 41)