CS194-26 Project 1 Images of the Russian Empire: Colorizing the Prokudin-Gorskii photo collection

Rishi Upadhyay, 3033975663, rishi.upadhyay@berkeley.edu

Project Overview

For this project, our goal was to create a tool that could align R, G, and B images and combine them into one cohesive color image. In order to handle multiple size and types of files, we used both single-scale and multi-scale techniques on the images.

For single-scale matching, we simply shift the images by an offset and compute a metric, in this case the sum of squared differences (SSD). After testing a whole range of these offsets, we find the offset with the smallest SSD and then return that.

For multi-scale matchine, we first compute multiple smaller versions of our initial images. We downsample the image by 2 each time. We then start with the smallest, lowest resolution image and use our single-scale matching to find a match. We then use this match as a starting point and refine it with the images one resolution higher, continuing this process until we are back to the full sized images. This allows us to find larger offsets without excessive computation.

Bells & Whistles

In order to improve performance, we included 2 additional preprocessing steps. We believe only the second counts as a bell/whistle: 1) We cropped the outside 20% of the image out and only used the inside to compute the metric 2) We applied a basic renormalization to try to even out the intensities between different images.
Renormalization
This method worked by computing z-values for every pixel in our image and then remapping those to a Guassian centered at (127,127,127) with standard deviation 45. The goal here was to normalize the brightness between the different images in cases where some are darker/lighter than others. Here is an example of the effect it has on images:

The left-most image gets lighter while the other two get lighter.

Results

All offsets are represented as [x,y]

Cathedral

Red-Green offset: [1,7], Blue-Green offset: [-2,-5]. Done with single-scale matching.

Church

Red-Green offset: [-8,33], Blue-Green offset: [-4,-25]. Done with multi-scale matching.

Emir

Red-Green offset: [18,56], Blue-Green offset: [-24,-48]. Done with multi-scale matching.

Harvesters

Red-Green offset: [-3,65], Blue-Green offset: [-17,-59]. Done with multi-scale matching.

Icon

Red-Green offset: [5,48], Blue-Green offset: [-17,-40]. Done with multi-scale matching.

Lady

Red-Green offset: [3,61], Blue-Green offset: [-8,-49]. Done with multi-scale matching.

Melons

Red-Green offset: [3,96], Blue-Green offset: [-10,-81]. Done with multi-scale matching.

Onion Church

Red-Green offset: [10,57], Blue-Green offset: [-26,-51]. Done with multi-scale matching.

Self Portrait

Red-Green offset: [8,98], Blue-Green offset: [-29,-78]. Done with multi-scale matching.

Three Generations

Red-Green offset: [-3,59], Blue-Green offset: [-14,-50]. Done with multi-scale matching.

Tobolsk

Red-Green offset: [1,4], Blue-Green offset: [-3,-3]. Done with single-scale matching.

Train

Red-Green offset: [26,43], Blue-Green offset: [-6,-42]. Done with multi-scale matching.

Workshop

Red-Green offset: [-11,52], Blue-Green offset: [1,-53]. Done with multi-scale matching.

The next 3 are not example images

Cheremkah

Red-Green offset: [12,50], Blue-Green offset: [94,28]. Done with multi-scale matching.

Murgab

Red-Green offset: [6,81], Blue-Green offset: [-19,-72]. Done with multi-scale matching.

Arch

Red-Green offset: [-8,33], Blue-Green offset: [-4,-25]. Done with multi-scale matching.