The goal of this assignment is to take the digitized Prokudin-Gorskii glass plate images and, using image processing techniques, automatically produce a color image with as few visual artifacts as possible. In order to do this, I extract the three color channel images, place them on top of each other, and align them so that they form a single RGB color image.
Since the jpg files are small, it is enough to use for loops to search the image for a window of displacements for the best result.
I found the minimum L2 norm between the R and B channels as well as the G and B channels in a [-15, 15] displacement window. After finding the best shifts, I shifted the R and G channels and then recombined all 3 channels to form the resulting colorized image.
At first, I tried to calculate the L2 norm for all possible shifts of one channel against the other channel, but I found that it took way too much time to obtain a result. Therefore, I limited my search to a [-15, 15] window as most of the channels did not have large displacements to begin with. Another issue that I faced was that some of the channels were not aligning correctly even after I found the minimum L2 norm. I managed to fix this by cropping more of the image - I found that cropping 5% off each border was not enough so I increased it to 7%.
For larger images, the search window of [-15, 15] may not be enough to find the best displacement. Due to the size of the images, an exhaustive search over a larger search window would take too long. Therefore, I used an image pyramid to repeatedly downscale the large image until it is a manageable size, which I set to be a size less than 300x300. I apply the single-scale alignment procedure on this downscaled image. Afterwards, I scale the aligned image back up and search in a [-3, 3] range for the displacement in the larger image. This is done to fine-tune the image displacement to ensure that the images are aligned in the best possible way. This process is repeated until the images have been scaled back up to the original size.
I had some issues with the image emir.tif. When I used the same image pyramid alignment scheme as the other .tif files, I found that the red channel ended up being misaligned. This was because the blue channel was much brighter than the other channels. I was able to fix this issue by aligning on the green channel instead.
Here are some other examples, colorized by me, that I chose from the Prokudin-Gorskii collection.