Sergei Mikhailovich Prokudin-Gorskii had a clever idea. He decided to photograph everything he saw in three exposures using a red, green, and blue filter. Even though there was no color photography at the time, his glass plate negatives survived and we are now able to use them to produce colorized images from the past.
Goal: Take the Prokudin-Gorskii glass plate images and colorize them via image processing.
How: Divide each digitized glass plate scan into three color channels (R, G, and B). Properly align them on top of each other to get the colored result!
I used a simple sum of squared differences (SSD) algorithm to find the best alignment over a [-15, 15] window. The best (x, y) displacement value will be the one that minimizes the SSD value. I ignored the outer 10% of each image and instead chose to consider just the inner portion to avoid having the borders throw off the alignment calculations.Initially, I used the B channel as the reference to align the R and G channels, but realized this resulted in a slight discrepancy for emir.tif. After playing around a bit, I realized that using the G channel as the reference worked better (possibly because of the abundance of blue in the photo). Changing the reference channel didn't seem to affect the alignment of any of the other images. This algorithm worked well for the smaller jpg images, but it proved to be much too inefficient to process the bigger tif images quickly enough. Below are the resulting images:
I needed a much more efficient way to align the bigger images, which contained way more pixels than the jpg images used above. I used the image pyramid recursive approach to halve the size of the image until it was a more manageable size, then find the proper displacement at that level using the SSD algorithm mentioned above. This resulting displacement is multiplied by two each time it is scaled back up a level. We search over a window around this doubled displacement to make any adjustments, repeating this until it returns to its original size, each time finding an updated and more precise displacement for each channel. I manually found that a good window to search for the displacement when scaling back up was 7.
Here are the results for the larger tif images:
*Note: When I place the image obtained from using G as the reference channel (left) next to the image obtained when using B as the reference (right), it is clear that using G as the reference channel results in a clearer and better aligned image!
And results from a few other photos that I chose from the collection: