Project 1: Images of the Russian Empire:

Colorizing the Prokudin-Gorskii Photo Collection

By Tony Wan

1. Introduction

In this project, I implemented image alignment using two metrics: Sum of Squared Differences (SSD) and Normalized Cross-Correlation (NCC). The goal was to align images based on these metrics and improve alignment using a coarse-to-fine pyramid approach.

2. Methodology

The initial steps were as follows:

  1. Preprocessing: Read in the image file as double and seperate the RGB channels.
  2. Aligning: (a) Align the Green and Red channels to the Blue channel using either SSD (squared Euclidean distance) or NCC (normalized dot product) as the score metric.
    (b) Iteratively search in a ±15×15 window for the displacement with the best score.
    (c) Shift the channel with that displacement.
  3. Colorizing: Stack the shifted Green and Red channels and stack them on top of the Blue channel.
  4. Finishing: Save the colored image file and display it for visual inspection.

Some improvements made:

  1. For Preprocessing: Crop the borders of the images to elimate irrelevant black and white edges.
  2. For Aligning: Implement a pyramid approach by downsampling to handle large images efficiently.
  3. For Colorizing: Change the base channel from Blue to Green for better reference.

3. Results

3.1 Naive Implementation Results

cathedral.jpg
cathedral.jpg
Green Displacement: (-1, 1)
Red Displacement: (-1, 7)
tobolsk.jpg
tobolsk.jpg
Green Displacement: (2, 3)
Red Displacement: (3, 6)

3.1 Optimized Implementation Results

church.jpg
church.tif
Blue Displacement: (-4, -25)
Red Displacement: (-8, 33)
harvesters.jpg
harvesters.tif
Blue Displacement: (-16, -59)
Red Displacement: (-3, 65)
icon.jpg
icon.tif
Blue Displacement: (-17, -41)
Red Displacement: (5, 48)
lady.jpg
lady.tif
Blue Displacement: (-9, -51)
Red Displacement: (3, 61)
emir1.jpg
emir.tif (Aligning to Blue)
Green Displacement: (24, 49)
Red Displacement: (-388, 95)
emir2.jpg
emir.tif (Aligning to Green)
Blue Displacement: (-24, -49)
Red Displacement: (17, 57)

4. Conclusion

In conclusion, the image alignment was successfully implemented using both SSD and NCC metrics. The coarse-to-fine pyramid approach provided a significant speedup for large images. Cropping the images helped in eliminating border artifacts that could affect the alignment process. And aligning to different channels avoided the interference of emir's blue clothes.