Project Overview

This project aims to create color images from images on 3 different color channels (Red, Green, Blue) taken by Sergei Prokudin-Gorskii in the early 1900s. We can do so by aligning these images such that the colors overlap to form a single RGB image.

Approach

I started out by implementing the 2 suggested metrics - Sum of Squared Differences (SSD) and Normalized Cross-Correlation (NCC) and running an exhaustive search on the smaller .jpg images first. I used [-15,15] as the range for possible displacements and used SSD for most images, using NCC for tobolsk.jpg. I had problems with dealing with the borders so I automatically cropped 50 pixels from each side of the image before processing it.

For the larger .tif images, I implemented a pyramid search algorithm. Using a scale of 0.25, 5 levels and the [-15,15] range at the lowest level, I was able to significantly reduce the time to process these images to under a minute. I used SSD for almost all the tif images and cropped 500 pixels from each to remove the borders.

Outputs

Castle.tif

Displacements

  1. G align with B = (-972, 1006)
  2. R align with B = (-908, 1006) jpg

Cathedral.jpg

Displacements

  1. G align with B = (6, 29)
  2. R align with B = (12, 29) jpg

emir.tif

Displacements

  1. G align with B = (-978, 1023)
  2. R align with B = (-980, 1011)

    This image isn't perfectly aligned because of the brightness inconsistency between the 3 channels.

    jpg

harvesters.tif

Displacements

  1. G align with B = (-961, 1019)
  2. R align with B = (-900, 1023) jpg

Icon.tif

Displacements

  1. G align with B = (-980, 1023)
  2. R align with B = (-1188, 1279) jpg

Lady.tif

Displacements

  1. G align with B = (-967, 1023)
  2. R align with B = (-907, 1023) jpg

Melons.tif

Displacements

  1. G align with B = (-943, 1023)
  2. R align with B = (-846, 1023) jpg

Monastery.jpg

Displacements

  1. G align with B = (0, 27)
  2. R align with B = (4, 29) jpg

Onion_church.tif

Displacements

  1. G align with B = (-972, 1023)
  2. R align with B = (-915, 1023) jpg

Self_portrait.tif

Displacements

  1. G align with B = (-946, 1023)
  2. R align with B = (-850, 1023) jpg

Three_generations.tif

Displacements

  1. G align with B = (-972, 1023)
  2. R align with B = (-848, 959) jpg

Tobolsk.jpg

Displacements

  1. G align with B = (4, 29)
  2. R align with B = (8, 29) jpg

Train.tif

Displacements

  1. G align with B = (-980, 1022)
  2. R align with B = (-852, 943) jpg

Workshop.tif

Displacements

  1. G align with B = (-970, 1023)
  2. R align with B = (-918, 959) jpg

Example images

last_judgement.tif

  1. G align with B = (-972, 1022)
  2. R align with B = (-1357, 1471) jpg

mother_of_god.tif

  1. G align with B = (-993, 1019)
  2. R align with B = (-960, 1023) jpg

lilacs.jpg

  1. G align with B = (6, 29)
  2. R align with B = (11, 29) jpg