15-463(15-663):Computational Photography

Project #1 IMAGE OF THE RUSSIAN EMPIRE: Colorizing the Prokudin-Gorskii photo collection

Cheng-Yang Liu

Overview:

Sergei Mikhailovich Prokudin-Gorskii (1863-1944) was a Russian photographer, who took a series of photographs with separated spectrum (red, blue and green), before digital camera has been brought to the world. Prokudin-Gorskii's photographs, stored in gray scale, were not able to recover to color images at that time. The goal of this project is to reveal the original color by combining R, G and B channels of images.

Two major problems to solve:
1. Alignment
2. Computational Time

Approach:

To solve this two problems, I will describe them separately. Before aligning the images, I crop the images, and remain the central part. Because the edge of the image has too many noise.

  1. Alignment:
To align R,G and B channels, we have to find the similarity of three images. I have apply both Sum of Squared Differences (SSD) and Normalized Cross-correlation (NCC) metrics.

Sum of Squared Differences (SSD): SSD is simply compare the L2 norm distance between every pixels, and sum up all the distance. Two images are regarded as identical, while the score is zero. Therefore, we are looking for the lowest value of the sum.
Normalized Cross-correlation (NCC): On the other hand, NCC is a dot product between two normalized vectors. The range of NCC score is between -1 to 1. By normalizing the image signal, two images are similar when the NCC score close to 1. Hence, we are looking for the highest score.

For the overall process, first I set the Blue channel as the reference image, which is stable. Second, by shifting Red and Green channel images pixel-wise in two directions, we could compare the similarity with reference image, and find the best shifting distances by the above matching methods.

  2.Computational Time:
When we compare the similarity by shifting images pixel-wise, the computational time grows dramatically, specially to TIF file. To deal with this problem, we implement image pyramid trick. An image pyramid is a way to reduce computational cost. First, it compares the images in a coarser scale (smaller image) to get a rough guess of the shift. Then, based on the previous guess, we can search for a relative small area in a finer scale. Each scale can be regarded as a layer of pyramid.
For this approach, I set three layers for the small images, and five layers for the large images. Also, for the smallest scale, the search area is set as [-5,5], while each finer layer reduce [-1 1] pixels searching area.

Bells and Whistles:

In order to clear the borders noise, I try to find the long edges of the images, which can be regarded as the frame of the photographs. First, I implement Sobel edge detection, and we can find several long edges around the borders, which are the targets we are looking for. Fortunately, the long edges are straight lines either horizontal or vertical. So, this phenomenon make things easier. We can identify them by summing all the value horizontally or vertically, and select the points which are higher than a threshold. Finally, choose four lines closest to the center.

example_BWexample_BW_crop

Results:

Since we get the same consequence from SSD and NCC methods, we only shows the SSD output. Both results are saved in the "result" file.
The results will show as the following order in each row. SSD result, bells and whistles result.

Example Images:

Small Images:
offset: Red[Green X, Green Y]; Red[Red X, Red Y]

Name: 00106v.jpg; offset: Green[1 4], Red[-1 9];
00106v00106v
Name: 00757v.jpg; offset: Green[3 2], Red[5 5];
00757v00757v
Name: 00888v.jpg; offset: Green[1 6], Red[0 12];
00888v00888v
Name: 00889v.jpg; offset: Green[2 2], Red[3 4];
00889v00889v
Name: 00907v.jpg; offset: Green[0 2], Red[0 6];
00907v00907v
Name: 00911v.jpg; offset: Green[-1 1], Red[-1 13];
00911v00911v
Name: 01031v.jpg; offset: Green[1 1], Red[2 4];
01031v01031v
Name: 01657v.jpg; offset: Green[1 5], Red[1 11];
01657v01657v
Name: 01880v.jpg; offset: Green[2 6], Red[4 14];
01880v01880v

Large Images:
Click the image to download the original size of images.
offset: Red[Green X, Green Y]; Red[Red X, Red Y]

Name: 00029u.jpg; offset: Green[16 39], Red[33 91];
00029u00029u
Name: 00087u.jpg; offset: Green[38 48], Red[55 107];
00087u00087u
Name: 00128u.jpg; offset: Green[25 35], Red[38 51];
00128u00128u
Name: 00458u.jpg; offset: Green[5 42], Red[32 87];
00458u00458u
Name: 00737u.jpg; offset: Green[6 14], Red[14 49];
00737u00737u
Name: 00822u.jpg; offset: Green[25 57], Red[33 125];
00822u00822u
Name: 00892u.jpg; offset: Green[2 16], Red[4 42];
00892u00892u
Name: 01043u.jpg; offset: Green[10 -16], Red[17 11];
01043u01043u
Name: 01047u.jpg; offset: Green[20 24], Red[33 71];
01047u01047u

Example Prokudin-Gorskii Collection Result

The result five examples of own choosing, downloaded from the Prokudin-Gorskii collection. Click the image to download the original size of images.
offset: Red[Green X, Green Y]; Red[Red X, Red Y]

Name: 00245u.jpg; offset: Green[-7 28], Red[-19 108];
00245u00245u
Name: 00253u.jpg; offset: Green[17 17], Red[30 89];
00253u00253u
Name: 00617u.jpg; offset: Green[18 51], Red[21 118];
00617u00617u
Name: 01736u.jpg; offset: Green[-10 53], Red[-34 117];
01736u01736u
Name: 01886u.jpg; offset: Green[24 49], Red[55 103];
01886u01886u