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, we 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.
1. Channel extraction: First step is to extract the three images into blue, green and red channels. This is done by splitting the input image plate into three equally sized images.
2. Crop bands, if required: Using a constant crop margin, crop the channels to remove the black bands at the edges
3. Compute edges for matching: While it is possible to directly align RGB images, I added edge detection to make the matching faster and more accurate. I use the sobel edge detector from sklearn.
4. Run alignment: Images can be aligned by exhaustively searching for an optimal x,y displacement which minimizes the Sum of Squared Distance between the edges of two images. I used a search space of +-20px. However, this can get slow for larger high resolution images. To speed up SSD, we use an image pyramid which recursively computes SSD on a sub-sampled image. It reduces the search space by running SSD on a smaller image, then using the displacement estimates on a cropped region in the higher resolution image to correct the estimates and recursively repeats.
Cropping the black bands had mixed results - it was helpful for the smaller jpgs when directly running SSD, but it made results worse and some images would not align well.
Instead of running SSD on RGB channels, I computed the edges of images and used that as a feature for alignment. This has two benefits - it reduces the runtime complexity and the output images were much sharper. For instance, compare the Melons and Emir results: