Fall 2018 CS194-26 Project1
IMAGES OF THE RUSSIAN EMPIRE: Colorizing the Prokudin-Gorskii photo collection
Tiancheng Cai, 26220268, tchcai@berkeley.edu
Overview
The project takes the digitized Prokudin-Gorskii glass plate images and automatically produces colored images. To accomplish this, the three color channels are aligned and placed on top of each other to get a single RGB color image.
Approach
- The three color channels need to be aligned properly.
- Two metrics are tried out for measuring alignment between any two channels:
- SSD: Sum of Squared Difference
- NCC: Normalized Cross-Correlation
- A color channel (green) is set as reference. We want to find the offsets along x- and y-axis that minimize the metric.
- I implemented two versions to accomplish this:
- The naive approach searchs for integer offsets over [-15, 15] along both x and y axis for the alignment that minimize the metric.
- The better approach is to contrust image pyramids for each channels (with ratio 2 between levels), search from coarse to fine levels.
- Solutions to problems
- Initially I get rather bad alignment due to border
-
To resolve this, I take 0.1 * max(width, height) as border length, and only take the portion inside the border when aligning.
- Initially for larger images, my offset goes overboard.
-
Since the order of the channels in input looks like "blue, green, red" from top to bottom, I use the green channel in the middle as a reference. In this way, the offset is relatively small compared to using red or blue channel as a reference.
- Initially I get rather bad alignment due to border
Result
Required
Offsets are relative to GREEN channel!
- cathedral.jpg
Offset -- G: (0, 0), B(-2, 1), R(7, 0)
- monastery.jpg
Offset -- G: (0, 0), B(3, -1), R(6, 1)
- settlers.jpg
Offset -- G: (0, 0), B(-7, 0), R(8, -1)
- nativity.jpg
Offset -- G: (0, 0), B(-3, -1), R(4, 0)
- emir.tif
Offset -- G: (0, 0), B(-48, -22), R(57, 15)
- harvesters.tif
Offset -- G: (0, 0), B(-58, -12), R(65, -2)
- icon.tif
Offset -- G: (0, 0), B(-40, -16), R(48, 5)
- lady.tif
Offset -- G: (0, 0), B(-47, 4), R(52, -9)
Additional
Offset -- G: (0, 0), B(-60, 27-), R(67, 6)
Offset -- G: (0, 0), B(-31, -3), R(47, 2)
Offset -- G: (0, 0), B(23, -5), R(-12, 2)
Offset -- G: (0, 0), B(-25, 18), R(90, -18)