College Seal

CS180 Class Repository - Garv Goswami

Project 1: Colorizing the Prokudin-Gorskii Photo Collection

Overview

This project aligns digitized glass plate negatives from Sergei Mikhailovich Prokudin-Gorskii into modern color images. Each input file contains three grayscale channels stacked vertically in the order Blue, Green, Red, an example shown below:

Cathedral
Cathedral — Prokudin-Gorskii collection
My task was to align the Green and Red channels to the Blue channel to produce sharp RGB results.

Approach

I implemented both a single-scale exhaustive search and a pyramid-based approach for high-resolution images. The difference bewteen these two approaches is conceptually simple. The single-scale search is a simple iterative search that aligns one layer to another in variable step size, finally reutrning the alignment that produced the best score for some predefined metric.

The pyramid-based search is pretty much the same thing and does indeed use the simple iterative search in it's execution, but we instead optimize for large images. We downscale and convolute images repeatedly, gaining a collection of images that are decreasingly resolutioned than the original. The iterative alignments for those downscaled and blurred images are then used to define the search neighborhoods as we move up the pyramid, decreasing the necessary search space. To evaluate alignments, I used two metrics: L2 norm (pixel-wise difference, smaller is better) and Normalized Cross Correlation (NCC) (dot product of normalized, zero-centered images, larger is better).

Since np.roll wraps pixels around, I added helper functions to compute metrics only over true overlapping regions. For large .tif images, I used a Gaussian pyramid: aligning at coarse scale and then refining at finer scales.

Function Explanations

Iterative Alignment Results

Before moving to the multi-resolution pyramid search, I also tested the simpler single-scale iterative alignment approach. Below are the results for three of the provided .jpg images: Cathedral, Monastery, and Tobolsk.

Cathedral (Iterative)

Best Red Shifts: (3, 12) | Best Green Shifts: (2, 5)

Cathedral uncropped iterative

Monastery (Iterative)

Best Red Shifts: (2, 3) | Best Green Shifts: (2, -3)

Monastery uncropped iterative

Tobolsk (Iterative)

Best Red Shifts: (3, 6) | Best Green Shifts: (3, 3)

Tobolsk uncropped iterative

Pyramid Alignment Results

Here are results on all of the provided images. Each block shows the stacked (unaligned), uncropped (aligned), and cropped (final) versions, along with the best shifts I found.

Emir

Best Red Shifts: (57, 103) | Best Green Shifts: (24, 49)

Emir stacked Emir uncropped Emir cropped

Italil

Best Red Shifts: (35, 76) | Best Green Shifts: (21, 38)

Italil stacked Italil uncropped Italil cropped

Church

Best Red Shifts: (-4, 58) | Best Green Shifts: (4, 25)

Church stacked Church uncropped Church cropped

Three Generations

Best Red Shifts: (11, 112) | Best Green Shifts: (14, 53)

Three Generations stacked Three Generations uncropped Three Generations cropped

Lugano

Best Red Shifts: (-29, 93) | Best Green Shifts: (-16, 41)

Lugano stacked Lugano uncropped Lugano cropped

Melons

Best Red Shifts: (13, 178) | Best Green Shifts: (11, 82)

Melons stacked Melons uncropped Melons cropped

Lastochikino

Best Red Shifts: (-9, 75) | Best Green Shifts: (-2, -3)

Lastochikino stacked Lastochikino uncropped Lastochikino cropped

Icon

Best Red Shifts: (23, 89) | Best Green Shifts: (17, 41)

Icon stacked Icon uncropped Icon cropped

Siren

Best Red Shifts: (-25, 96) | Best Green Shifts: (-6, 49)

Siren stacked Siren uncropped Siren cropped

Self Portrait

Best Red Shifts: (37, 176) | Best Green Shifts: (29, 79)

Self Portrait stacked Self Portrait uncropped Self Portrait cropped

Harvesters

Best Red Shifts: (14, 124) | Best Green Shifts: (17, 60)

Harvesters stacked Harvesters uncropped Harvesters cropped

Monastery

Best Red Shifts: (2, 3) | Best Green Shifts: (2, -3)

Monastery stacked Monastery uncropped Monastery cropped

Tobolsk

Best Red Shifts: (3, 6) | Best Green Shifts: (3, 3)

Tobolsk stacked Tobolsk uncropped Tobolsk cropped

Cathedral

Best Red Shifts: (3, 12) | Best Green Shifts: (2, 5)

Cathedral stacked Cathedral uncropped Cathedral cropped

My Own Examples

I also processed additional glass plate scans from the Prokudin-Gorskii collection. The first was a high resolution tif image. The second is a lower resolution jpg. Below are the two examples aligned using the same pipeline:

Group of eleven adults and children, seated on a rug, in front of a yurt

Best Red Shifts: (49, 130) | Best Green Shifts: (31, 58)

[Group of eleven adults and children, seated on a rug, in front of a yurt]

[Group of eleven adults and children, seated on a rug, in front of a yurt] Not too bad. High resolution images will of course be shakier.

V Alupkie. Krym

Best Red Shifts: (-3, 14) | Best Green Shifts: (-1, 3)

V Alupki︠e︡. Krym

[V Alupkie. Krym] As expected, a better alignment for a lower res image.

Failures and Future Improvements

Although the alignment pipeline works reasonably well overall, two key issues still stand out:

How I Tried to Fix Emir

  • Trimmed borders more: increased border trim (≈8% -> 10%) to ignore black frames and scan artifacts.
  • Stronger pyramid search: added a level and used a slightly larger search window at each scale.

Together, these fixes made a small, but noticeable difference.

Bells and Whistles

Unfortunately nothing. I tried to get the overlap crop to work, but it took too long and I have other homework.