Project 1 of 5

Colorizing the Prokudin-Gorskii Collection

Reconstructing color photographs from Sergei Prokudin-Gorskii's glass-plate scans by aligning the blue, green, and red exposures with a coarse-to-fine image pyramid.

Ziteng Ji CS 180: Intro to Computer Vision UC Berkeley · Fall 2025
  • Image Alignment
  • Image Pyramids
  • NCC / SSD
  • Sobel Edges
Colorizing the Prokudin-Gorskii Collection
Overview

This project reconstructs color photographs from Sergei Prokudin-Gorskii’s digitized glass plates by splitting each plate into three grayscale channels (B, G, R) and aligning G and R to B using only x-y translations. We score candidate shifts with simple similarity metrics (e.g., L2/SSD or NCC) and report the chosen displacement vectors. To handle large, high-resolution scans efficiently, we accelerate alignment with a coarse to fine image pyramid. The result is a single, well-aligned RGB image with minimal visual artifacts.

Background

Sergei Mikhailovich Prokudin-Gorskii pioneered early color photography by capturing three sequential exposures of the same scene through blue, green, and red filters on a single glass plate. Decades later, the Library of Congress digitized these B-G-R plates, revealing remarkable views of the late Russian Empire but also exposing practical issues: the three channel images are vertically stacked, often misaligned, and can differ in intensity or contrast. Reconstructing a faithful color photo therefore requires separating the plate into its three grayscale channels and precisely aligning the green and red images to the blue reference using a translation model.

church rgb
church colorized

Methodology

I split each glass plate into three grayscale images B,G,R (top→bottom) and treat alignment as integer translations of G and R onto the base channel B. For any candidate shift (Δy,Δx)(Δy,Δx), I compare only the valid overlap between the two images(no wraparound) then choose the shift that maximizes a similarity score.

Before scoring, each image is optionally converted to an edge map with a Sobel filter to suppress color differences, then standardized to zero-mean, unit-variance:

I^=Sobel⁡(I)−μσ+ε\hat{I}=\frac{\operatorname{Sobel}(I)-\mu}{\sigma+\varepsilon}

Similarity Metric

I support SSD and NCC; both are maximized:

SSSD(A,B)=−∑(y,x)(A(y,x)−B(y,x))2,SNCC(A,B)=∑A⋅B∥A∥2∥B∥2S_{\text{SSD}}(A,B)=-\sum_{(y,x)}\left(A(y,x)-B(y,x)\right)^2,\qquad S_{\text{NCC}}(A,B)=\frac{\sum A\cdot B}{\|A\|_2 \|B\|_2}

By default I use NCC on edges, which is insensitive to global brightness and works well when channel intensities differ.

Single Scale Exhaustive Search

Given a center (cy,cx)(c_y , c_x) and radius rr (default rr = 15), I evaluate all integer shifts (Δy,Δx)∈[cy±r]×[cx±r](Δy,Δx)∈[c_y ± r]×[c_x ± r]. For each candidate, I compute the valid overlapping slices, apply the interior crop, score with SSD/NCC, and keep the argmax. This yields (ΔyG,ΔxG)(Δy_G , Δx_G) for G→BG→B and (ΔyR,ΔxR)(Δy_R , Δx_R) for R→BR→B.

Coarse to Fine Pyramid

To handle large .tif scans efficiently, I build a Gaussian pyramid by repeatedly downscaling by 0.50.5 (anti-aliased) until the minimum dimension is ≤400≤ 400. Starting from the coarsest level, I run the exhaustive search (wide radius at the coarsest, radius=4radius = 4 at finer levels) and propagate shifts upward by doubling the previous estimate to seed the next level. The final level returns the pixel-accurate integer shift.

Warping & Composition

I apply the estimated shifts with safe overlap (no wrapping) to obtain G′,R′G ′, R ′ , then stack into RGB as [R′,G′,B][R ′, G ′, B]. The result is clipped to [0,1][0, 1] and saved as 8-bit (img_as_ubyte) to avoid format issues.

Conclusion: Why These Choices?

Edges + NCC increase robustness to channel-dependent brightness; interior cropping avoids border artifacts; integer translations match the assignment model; and the pyramid preserves accuracy while cutting the brute-force search cost by orders of magnitude.

Result

if you are using my codebase, please run python proj1.py xxx.jpg or python proj1.py xxx.tif

cathedral colorized

G:(2, 5), R:(3, 12)

monastery colorized

G:(2, -3), R:(2, 3)

tobolsk colorized

G:(3, 3), R:(3, 6)

church colorized 1

G:(4, 25), R:(-4, 58)

emir colorized

G:(24, 49), R:(40, 107)

harvesters colorized

G:(17, 60), R:(17, 124)

icon colorized

G:(17, 42), R:(23, 90)

italil colorized

G:(22, 38), R:(36, 77)

lastochikino colorized

G:(-2, -3), R:(-8, 76)

lugano colorized

G:(-17, 41), R:(-29, 92)

melons colorized

G:(10, 80), R:(13, 177)

self portrait colorized

G:(29, 78), R:(37, 176)

siren colorized

G:(-6, 49), R: (-24, 96)

three generations colorized

G:(12, 54), R:(9, 111)

self selected1 colorized

G:(-8, 48), R:(-15, 111)

self selected colorized

G:(-17, 41), R:(-29, 92)

self selected3 colorized

G:(-16, 33), R:(-25, 78)

self selected4 colorized

G:(-12, 24), R:(-22, 96)

1 2 3 4 5