Programming Project 1: Images of the Russian Empire

Bryant Le: CS194-26-acu

We take Sergei Mikhailovich Prokudin-Gorskii's idea to record three exposures of every scene in three different colors and apply that to our project. The goal of this first project was to take Prokudin-Gorskii's glass plate images, and to use image processing techniques to recreate the scene. Some of the strategies that were explored include using normalized correlations and image pyramids.

Processing Smaller Images

Initially, we were given the red, blue, and green exposures. However, when I tried to stack these images, they did not stack perfectly and the overall image was unclear. My first strategy was to align the Red and Green exposure with the Blue exposure by shifting the exposure around [-15, 15] pixels and calculating for the normalized correlation. By looking for the shift with the greatest normalized correlation, I was able to find the alignment. However, the monastery's red exposure was slightly off. I fixed this offset by aligning the Green and Blue exposures to the Red exposure! Here are some examples:

Tobolsk: Green -4, -1. Blue -6, -3

Monastery: Green -6, -1. Blue -9, -1

Cathedral: Green -7, 0. Blue -7, 1

Processing Larger Images

However, this image processing strategy took too long with larger images(.tif). I am assuming that this is because calculating correlation for a very large image would take a very long time, especially if you have to do it for even more alignments than on smaller images. I used an image pyramid to speed up this process. It is essentially narrowing down the search by aligning the image on different scales. This worked for most of the images. This step took a while because I was struggling to understand the recursion for the pyramid. Thus, I started by aligning the smallest image, and slowly working my way up with the small calculations until the recursion was consistent. Here are some examples:

Workshop: Red 53, -12. Blue -52, 0

Three_generations: Red 60, -4. Blue -48, -16

Icon: Red 48, 6. Blue -40, -18

Melons: Red 96, 4. Blue -80, -6

Onion Church: Red 58, 10. Blue -49, -26

Processing Edge Case Images

I cropped off the edges of the images to focus on the main aspect of the images. Now, most of the images have been closely aligned. However, there was still more that I could have done to better align them. Especially because some of the images were still poorly aligned. I tried changing the base exposure, but none of those changes made any differences. I was then suggested that I should add an offset to that crop when I crop during my pyramid process. I tested different amounts of offsets until I found one that fixed most of the images. This worked because cropping the image of its poorly aligned edges better captured the correct correlation between two images / exposures. Here are the examples with offsets 0, 10, and 25:

Emir: Red 58, 17. Blue -48, -23.

Train: Red 43, 26. Blue -42, -6

Lady: Red 58, 4. Blue -50, -6

Village: Red 72, 10. Blue -64, -12

Workshop: Red 53, -12. Blue -52, 0

Processing Additional Images.

Before -> After

Before -> After

>