Prokudin-Gorskii has produced pictures through BGR filters (in order). This project tries to build colorful images which Prokudin-Gorskii did not have the chance to print.
I first approach each of the image by trying out all displacements from x and y coordinates with the range of [-15, 15], with metrics of l2 norm and normalized cross correlation(ncc). However, the borders often interfere with the metrics so I decide to crop the 7.5% from each side. The results are good in ncc metric.
Pictures above were all in jpg form so the runtimes for aligning were low. However, we have some very big files in tif forms so we need to implement a faster algorithms: pyramid. The pyramid method, in its nature, is also doing searching. Instead of performing exhaustive search, it begins searching from a blurry picture to reduce the amount of pixels processed. When the first level of blurry images are aligned(using the regular alignment function), we get to the second level with finer images and the displacements we received from the first level. This is a recursive algorithm and is ~4 times faster than exhaustive search.
Then, I have some self select images
Emir is a special case. The pyramid search did not work well on this image. That's because The Emir's blue jacket captures a lof of light in the blue channel but not so much in the green and red channels What work previously does not work now. My approach is to use Sobel operator on the original raw image first and then try to use pyramid method to align the Sobel'ed image.
After I apply cv.sobel to emir image and align the sobel images, I get this
With the offsets from the sobel images, I can now apply the offsets to the original image.