CS 194-26: Image Manipulation and Computational Photography, Fall 2017

Project 1: Colorizer

Sheng-Yu Wang

(Html template credited to Yujie Wen.)



Overview

The goal of this assignment is to take the digitized Prokudin-Gorskii glass plate images and, using image processing techniques, automatically produce a color image with as few visual artifacts as possible. The project coarsely contains two steps. The first step is to align three (B, G, R) images with certain metrics that measures the "off-ness" of two image positions. After the images are aligned, the second step is to combined three images into a color image. Optimizations such as white balance are not implemented in this project.

Approach

Constructing Image Pyramid

Shrink the image by a half recursively until a threshold length or height is reached. The image pyramid can help reduce the alignment runtime by far.

Border Cropping

To avoid taking into account of the black and white border while aligning, 10% of the length and width is cropped for each edge in the reference image.

Alignment

Recall that the reference image is cropped. The size of the cropped reference image can be served as a window for the image we are trying to align. By moving around the window and calculate the difference by NCC(normalized cross-correlation) metric, we can find the best position of the window that maximizes the correlation, and that will be the offset we are trying to find. Note by implementing the image pyramid, the exhaust search of the window position can be reduced by far, which much decreases the runtime of the algorithm.

NCC

A dot product between two normalized vectors: (image1./||image1|| and image2./||image2||). Note that we can get the image vector by simply reshape the matrix into a vector. The correlation serves as a metric to determine the offness of two image positions.

Results

cathedral.jpg:
G+(5, 2) R+(12, 3)
monastery.jpg:
G+(-3, 2) R+(3, 2)
nativity.jpg:
G+(3, 1) R+(7, 0)
settlers.jpg:
G+(7, 0) R+(15, -1)
emir.tif:
G+(49, 24) R+(104, 56)
harvesters.tif:
G+(60, 17) R+(124, 13)
icon.tif:
G+(41, 17) R+(89, 23)
lady.tif:
G+(55, 8) R+(117, 11)
self_portrait.tif:
G+(79, 29) R+(176, 37)
three_generations.tif:
G+(53, 14) R+(112, 11)
train.tif:
G+(43, 6) R+(87, 32)
turkmen.tif:
G+(56, 21) R+(116, 28)
village.tif:
G+(65, 12) R+(138, 22)
Additional: 1.jpg:
G+(18, 6) R+(40, 11)
Additional: 2.jpg:
G+(4, 2) R+(10, 3)
Additional: 3.jpg:
G+(-2, 0) R+(2, 0)
Additional: 4.jpg:
G+(-1, 0) R+(5, 1)