The goal of this project is to recolorize the digitized glass pane Prokudin-Gorskii photos by aligning the 3 color channels to produce a high quality image. Using the skimage library, we are able to manipulate the grayscale photos and calculate displacements of each color channel using Sum of Squared Differences and Pyramid Image Speedup techniques.
I started off by calculating SSD on the smaller images. This worked well for cathedral.jpg and tobolsk.jpg, but not monastery.jpg. After cropping the sides by 10% of the width, I was able to align it well. Cropping the images (including for the .tif files) helped a lot- this is because SSD would take into account the black borders on the outside and ultimately attempt to align the borders (which would skew the actual image).
For the larger images, the pyramid speedup was necessary to achieve a good runtime. I used a scale factor of 0.5 for every level and set my base case to size 400, which had a runtime of around 30-40 seconds for the .tif files. My first implementation didn't search additional displacements and only used the best SSD for the topmost layer. This was fast but ended up being a little bit blurry since the SSD was based off of a very low resolution, small scale of the image. Once I implemented a separate method with the adjusted displacement and after cropping the sides and top, I was able to get a clearer image, except for the emir.tif file. I was able to align the emir.tif file after I aligned red to the aligned green image, instead of aligning green to blue and red to blue separately. This helped a little with other images as well. The only picture that didn't work was the melons.tif with the alignment on blue. I was able to get a better result by shifting blue and red onto green.
Green: [16, -4] Red: [116, -14]
Green: [64, 15] Red: [127, 9]
green: [58, -16] Red: [119, -32]
green:[68, 68] red:[106, 78]
Green: [55, 8] Red: [119, 11]
Green: [35, 3] Red:[99, 4]
Blue: [-83, -10] Red: [104, 4]
green:[59, 16] red:[119, 13]
green[42, 5] red[85, 32]
green:[51, 26] red:[108, 36]
green[41, 17] red[89, 22]
green[52, 0] red[104, -11]
green[78, 29] red[176, 37]
green[49, 24] red[106, 41]
green[53, 14] red[111, 11]
green:[5, 2] red: [12, 3]
green:[-3, 2] red: [3, 2]
green:[3, 2] red:[6, 2]