# CS 194-26 PROJECT 1 - Colorizing the Prokudin-Gorskii photo collection¶

## I. Overview¶

The goal for this project was to accurately align 3 versions (red, green, blue) of the same photo to create a cohesive color image. This was done by first separating the 3 vertically stacked images (see sample below), then finding the best alignment for them using various algorithms. Here's a sample input: And a sample output:

## II. Method¶

• Load the image into the program.
• Partition the image into its individual color channels.
• Pre-crop the edges of the image to get rid of most black-space on the outside edges. I have cropped the height by 1/24 of the original height on both sides and 1/12 of the width on both sides.
• Align the images since they were taken at slightly different heights. For alignment, I have implemented a recursive image pyramid. The depth varies - I empirically found that aligning with a starting image of ~100x100 works best for the base case, then work my way up from there. The depth I go to is therefore log2(height / 100). Once the best alignment at the max depth is found, I simply have to align within the 4 pixels the one pixel turns into at the next level.
• Crop the edges to remove minor shifting. I remove 1/100th of the original width and height.
• Stack the aligned channels and save the resulting image.
• ### Final Results¶

workshop.tif
Red Offset: ( -12 , 104 )
Green Offset: ( 0 , 52 )