Assignment #1 - Zilin Zhang (zilinzha)

Project Overview

This project aims to develop an algorithm that aligns and combines three color channels (red, green, and blue) of an image to create a colorized output. The algorithm starts with a basic single-scale version using for-loops to search for the best alignment across a specified displacement window. Initially tested on a smaller image, the project progresses to include a multi-scale, pyramid approach for efficiently handling larger images.

Approach Description

For this project, I use normalized cross-correlation as a metric to measure similarity between color channels, guiding the alignment process. Initially, it searches exhaustively within a predefined displacement window to align the channels. To improve efficiency and manage larger images, I then try to adopt a pyramid alignment strategy. This strategy involves creating lower-resolution versions of the original image channels and aligning them starting from the coarsest level. Optimal offsets found at lower resolutions guide the alignment at higher resolutions, iteratively refining the alignment until reaching the full resolution. This multi-scale approach reduces computational load, making the algorithm suitable for large images.

Result

Results of all example images are here.

Sample Image Sample Image Sample Image Sample Image Sample Image Sample Image Sample Image Sample Image Sample Image Sample Image

Results of images chosen by myself are here.

Sample Image Sample Image Sample Image

Of all images, the emir.tif image does not align quite well, especailly on the x-axis, the reason could be the normalized vector can not descibe the pattern of this image, or out of range of the values.

The offsets of all images are here.

Input Image Green Offset (X, Y) Blue Offset (X, Y)
cathedral (-7, -1) (-12, -3)
icon (-48, -4) (-92, -24)
harvesters (-68, 4) (-124, -8)
self_portrait (-96, -4) (-132, 4)
three_generations (-60, 0) (-112, -8)
train (-44, -24) (-112, 0)
turkmen (-60, -4) (-112, -4)
village (-72, -8) (-132, -24)
lady (-60, -4) (-112, -12)
emir (-88, 42) (-104, 36)
00125v.jpg (-4, 1) (-10, -1)
00149v.jpg (-5, 0) (-9, -1)
01112v.jpg (-5, -2) (-5, -1)