CMU 16726 Learning Based Image Synthesis

Assignment #1 - Colorizing the Prokudin-Gorskii Photo Collection

Lifan Yu (lifany)

1. Project Overview

1.1 Background

Sergei Mikhailovich Prokudin-Gorskii (1863-1944) envisioned colored photography and recorded three exposures of every scene onto a glass plate using a red, a green and a blue filter.

In this project, the glass plate images are processed and used to produce colored images.

1.2 Methods

- I chose SSD as the alignment metric.

- For alignment, first aligning red to green, then blue to green, and then stacking the three channels (aligned red, aligned blue, green) together. Most of the images have the same brightness across all color channels, aligning the other 2 channels with the third will work, except for the emir image, in which the green channel has a different brightness level from the other two.

- First I tried the single-scale alignment, it performs better on low-res images, but is extremely slow and performs poorly on high-res images, as we are only shifting once and computing brightness SSDs across all the image pixels, which has too much details and can fail to produce an approximately correct shifting

- Then I used multi-scale pyramid method, first down-scaling the high-res images to a tiny image, compute SSD and shift to align, then up-scale the image by a constant, again compute SSD and shift the color channels to align with each other. This is repeated until the image is up-scaled back to the original size. We shift the image several times, and with each up-scaling, the new shifting is a finer-tuned shift. This method is much quicker than the single-scale one, and performs quite well on almost all images

2. Results

2.1 Single-scale implementation with successful results on low-res images

Cathedral

Lady

Forest

2.2 Multiscale pyramid version that works on the large images

Multiscale pyramid method works well and fast on almost all images.

However, the Emir image isn't properly aligned.

This is due to the Emir image's green channel having a different brightness level than others channels.

To solve this, I instead aligned the two other channels to green and solved the problem. The new aligned Emir image can be seen at the end of this subsection

Self-portrait

Lady

Forest

Emir

Forest

Three generations

Forest

Icon

Forest

Turkmen

Forest

Village

Forest

Train

Forest

Cathedral

Harvesters

Forest

Emir misalignment

Forest

Aligned Emir image

Forest

2.2.2 Comparison between multiscale pyramid version single scale

Self-portrait with single-scale alignment

Forest

Self-portrait with multiscale pyramid method

Forest

Turkmen with single-scale alignment

Forest

Turkmen with multiscale pyramid method

Forest

2.3 My own choice of images downloaded from the Prokudin-Gorskii collection

Data source

Image 00453a

Forest

Image 00472a

Forest

Image 00434a

Forest

Image 00447u

Forest

Image 00729u

Forest

Image 00777u

Forest

3. Bells & Whistles (Extra Credit)

3.1 Pytorch reimplementation

A screenshot of pytorch tensor implementation is as follows:

Forest

3.2 Automatic contrasting

I rescaled the brightness level to minimum = 0 and maximum = 1, then I scaled the brightness by a constant, scaling up the ones above the average value, and scaling down the ones below, depending on the brightness level itself and color channels. The values are finally clipped between [0, 1]

Self-portrait

Forest

Self-portrait with contrast

Forest

Turkmen

Forest

Turkmen with contrast

Forest

Lady

Forest

Lady with contrast

Forest

Emir

Forest

Emir with contrast

Forest

Three generations

Forest

Three generations with contrast

Forest

Harvesters

Forest

Harvesters with contrast

Forest

Cathedral

Forest

Cathedral with contrast

Forest

Icon

Forest

Icon with contrast

Forest

Village

Forest

Village with contrast

Forest

Train

Forest

Train with contrast

Forest

3.3 Automatic cropping

- First I removed the originally existing black edges by detecting the edges with a threshold.

- Then I recorded the shifts in the two channels being aligned. I crop out these misalgned edge areas by cropping using the corresponding values.

Self-portrait with contrast

Forest

Self-portrait cropped

Forest

Turkmen with contrast

Forest

Turkmen cropped

Forest

Lady with contrast

Forest

Lady cropped

Forest

Emir with contrast

Forest

Emir cropped

Forest

Three generations with contrast

Forest

Three generations cropped

Forest

Harvesters with contrast

Forest

Harvesters crop

Forest

Cathedral with contrast

Forest

Cathedral cropped

Forest

Icon with contrast

Forest

Icon cropped

Forest

Village with contrast

Forest

Village cropped

Forest

Train with contrast

Forest

Train cropped

Forest