Background

The goal of this assignment is 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. Thus, I extracted the three color channel images, placed them on top of each other and aligned them so that they form a single RGB color image.

Single-Scale Alignment

Approach

First, I processed and prepared the .jpg image by splitting it into three equal sections, cropping the outer 15% of the image to remove the dark or black borders and yield a more accurate alignment. I then aligned the images by exhaustively searching over the interval [-15, 15] and finding the best alignment based on Normal Cross-Correlation (NCC). A higher NCC meant a better alignment. Finally, I returned the image with the best alignment, or highest NCC.

Aligned Images

cathedral.jpg
cathedral.jpg
Green: (5, 2)
Red: (12, 3)
monastery.jpg
monastery.jpg
Green: (-3, 2)
Red: (3, 2)
tobolsk.jpg
tobolsk.jpg
Green: (3, 3)
Red: (6, 3)

Multiscale Alignment (Image Pyramid)

Approach

In order to process larger .tif images, I used image pyramids. I processed every image using the same method as I did in the single-scale alignment. Then, I rescaled the image by 0.5 , halving its size for 2 iterations. This means that the pyramid has 2 levels of 0.5 and 0.25 of the original image. I aligned the images starting from the coarsest level (level 2 , 0.25 of the original image), adding each level's displacement multiplied by 2^level to d = (dx, dy) , initialized to (0, 0) . Finally, I used d as the displacement to align the original .tif image and returned it.

Aligned Images

church.tif
church.tif
Green: (48, 8)
Red: (86, -8)
emir.tif
emir.tif
Green: (78, 44)
Red: (58, 40)
harvesters.tif
harvesters.tif
Green: (90, 34)
Red: (90, 14)
icon.tif
icon.tif
Green: (70, 34)
Red: (90, 46)
lady.tif
lady.tif
Green: (82, 16)
Red: (90, -6)
melons.tif
melons.tif
Green: (90, 4)
Red: (90, 4)
onion_church.tif
onion_church.tif
Green: (82, 56)
Red: (90, 66)
sculpture.tif
sculpture.tif
Green: (94, -30)
Red: (210, -78)
self_portrait.tif
self_portrait.tif
Green: (170, 80)
Red: (210, 144)
three_generations.tif
three_generations.tif
Green: (130, 42)
Red: (202, 30)
train.tif
train.tif
Green: (114, 18)
Red: (178, 94)

Custom Images

Summary

I chose 4 images from the given link in the project description. I downloaded 2 as .tif files and the other 2 as .jpg files. I aligned the .tif using multiscale alignment and the rest using single-scale alignment.

custom1.jpg
custom1.tif
custom1.png
Green: (70, 18)
Red: (90, 8)
custom2.jpg
custom2.tif
custom2.png
Green: (74, -24)
Red: (90, -54)
custom3.jpg
custom3.jpg
custom3.png
Green: (2, 1)
Red: (7, 1)
custom4.jpg
custom4.jpg
custom4.png
Green: (2, 2)
Red: (8, 4)