CS 280A Proj 1: Images of the Russian Empire

RGB Image Alignment by Alonso Martinez


Overview

Between 1863-1944, Prokudin-Gorskii took a pioneering collection of Red, Green, and Blue photos using multiple cameras and corresponding colored filters. Unfortunately, the translation (and possibly rotation and scale) are misaligned, which presents a learning opportunity for us to get our hands dirty in image manipulation. This challenge additionally creates an opportunity to learn about computational efficiency when digitally manipulating images.

Approach

We first divide the image’s height into three individual images. Then we create all possible permutations of the translated image within a window size and compare the alignment using the structural similarity method from skimage. To make it more computationally tractable for very large images (TIFs), we use a hierarchical resolution approach to align the images (pyramid resolution scheme).

I explored reducing for loops and roll operations by using a tiling approach in hopes of reducing the computational load. Unfortunately, I did not have enough time to confirm that this was a faster approach than individually transforming images. Additionally, I explored using “fancy indexing” to apply transformations in bulk for the set of tiling images, but could not finish in time.

Challenges

Accurate vector displacement during pyramid resolution scheme

While the algorithm achieved alignment, I realize that my vector displacement might be off, as it was relative to the previous level in the pyramid.

Computational efficiency

The biggest challenge was spending too much time on the fancy indexing approach. Instead of doing alignment at the highest resolution, I skipped this level, and in hindsight, exploring gradient descent on the error could have yielded more efficient results.

Results

JPGs

Aligned image of Cathedral
Displacement matrix:
Red: [5, 2], Green: [12, 3]
Aligned image of Monastery
Displacement matrix:
Red: [-3, 2], Green: [3, 2]
Aligned image of Tobolsk
Displacement matrix:
Red: [3, 2], Green: [6, 3]

TIFs

Aligned image of Sculpture
Displacement matrix:
Red: N/A, Green: N/A
Aligned image of Harvesters
Displacement matrix:
Red: N/A, Green: N/A
Aligned image of Self Portrait
Displacement matrix:
Red: N/A, Green: N/A
Aligned image of Lady
Displacement matrix:
Red: N/A, Green: N/A

Additional Images

Aligned image of Chalice
Displacement matrix:
Red: [7, 3], Green: [14, 5]
Aligned image of Mozhaisk
Displacement matrix:
Red: [4, 1], Green: [9, 3]
Aligned image of Napoleon
Displacement matrix:
Red: [6, 1], Green: [13, 0]