Colorizing the Prokudin-Gorskii Photo Collection

Images of the Russian Empire : Colorizing the Prokudin-Gorskii Photo Collection

CS194-26 Project 1, Spring 2020

By Sukrit Arora

sukrit.arora@berkeley.edu – cs194-ahb

Approach

The purpose of this assignment is to colorize the Prokudin-Gorskii photo collection. Each image contains information for each color channel (R, G, B); however, the data of each channel is not aligned. Thus, in order to generate a colored image, we need to align each color channel image so that the result is a cohesive colored image.

For smaller images, I exhaustively searched over a a window of [-15,15] for potential offsets in x and y and selected the values that minimized the SSD function (L2 Norm of flattened image difference).

For larger images, I used a multiscale pyramid to speed up computation. I first downsampled the image by log2(max(image_dimensions)) to get the smallest “base” image. I then calculate the offset on this image, upsample by a factor of 2, roll the resulting upsampled image by 2 * offset, and repeat this process until I get an image of the original dimensions.

For both kinds of images, I also crop the image so that we ignore the border when calculating offsets. For all images I shaved off 10% around the sides.

As you can see below, the results all around are fairly good. There are some images (melons, self_portrait) for which it doesn’t perform too well, but for the other images (icon, wall_painting) the results are quite good.

Small Image Results

monastery.jpg

Time Elapsed: 0.5207920074462891 for data/monastery.jpg

Green Offset: (-3, 2) for data/monastery.jpg

Red Offset: (3, 2) for data/monastery.jpg

tobolsk.jpg

Time Elapsed: 0.37480592727661133 for data/tobolsk.jpg

Green Offset: (3, 3) for data/tobolsk.jpg

Red Offset: (6, 3) for data/tobolsk.jpg

cathedral.jpg

Time Elapsed: 0.4832148551940918 for data/cathedral.jpg

Green Offset: (5, 2) for data/cathedral.jpg

Red Offset: (12, 3) for data/cathedral.jpg

Large Image Results

workshop.tif

Time Elapsed: 8.361983060836792 for data/workshop.tif

Green Offset: (51, 0) for data/workshop.tif

Red Offset: (102, -11) for data/workshop.tif

emir.tif

Time Elapsed: 9.632888078689575 for data/emir.tif

Green Offset: (48, 23) for data/emir.tif

Red Offset: (100, 54) for data/emir.tif

three_generations.tif

Time Elapsed: 9.591098070144653 for data/three_generations.tif

Green Offset: (52, 13) for data/three_generations.tif

Red Offset: (109, 11) for data/three_generations.tif

melons.tif

Time Elapsed: 10.848026752471924 for data/melons.tif

Green Offset: (79, 9) for data/melons.tif

Red Offset: (155, 10) for data/melons.tif

onion_church.tif

Time Elapsed: 10.901203155517578 for data/onion_church.tif

Green Offset: (49, 26) for data/onion_church.tif

Red Offset: (105, 35) for data/onion_church.tif

train.tif

Time Elapsed: 12.388075828552246 for data/train.tif

Green Offset: (41, 5) for data/train.tif

Red Offset: (85, 31) for data/train.tif

icon.tif

Time Elapsed: 11.453616857528687 for data/icon.tif

Green Offset: (39, 16) for data/icon.tif

Red Offset: (87, 22) for data/icon.tif

village.tif

Time Elapsed: 11.199136018753052 for data/village.tif

Green Offset: (62, 11) for data/village.tif

Red Offset: (133, 22) for data/village.tif

self_portrait.tif

Time Elapsed: 10.863592863082886 for data/self_portrait.tif

Green Offset: (76, 28) for data/self_portrait.tif

Red Offset: (155, 32) for data/self_portrait.tif

harvesters.tif

Time Elapsed: 10.905174016952515 for data/harvesters.tif

Green Offset: (58, 16) for data/harvesters.tif

Red Offset: (120, 13) for data/harvesters.tif

lady.tif

Time Elapsed: 10.896058082580566 for data/lady.tif

Green Offset: (49, 8) for data/lady.tif

Red Offset: (108, 11) for data/lady.tif

Extra Results from Library of Congress

cheremukha.tif

Time Elapsed: 10.82188606262207 for data/cheremukha.tif

Green Offset: (-29, -91) for data/cheremukha.tif

Red Offset: (22, -80) for data/cheremukha.tif

wall_painting.tif

Time Elapsed: 10.01022219657898 for data/wall_painting.tif

Green Offset: (-20, 11) for data/wall_painting.tif

Red Offset: (-8, 26) for data/wall_painting.tif

lodeinoe_pole.tif

Time Elapsed: 11.175855159759521 for data/lodeinoe_pole.tif

Green Offset: (22, 20) for data/lodeinoe_pole.tif

Red Offset: (58, 28) for data/lodeinoe_pole.tif