This project involved aligning images taken by Prokudin-Gorskii in the red, green and blue channels such that a colorized final image is produced as output. In order to achieve the desired alignment, the method explored in this project was one of shifting the green and blue channels and comparing with the red channel using a distance metric; the best shifts in the x- and y- directions corresponded to those with the most optimal value of the distance metric to perform the comparison. The final images in this project have been produced by using normalized cross-correlation as the distance metric. The project also addressed the development of an image pyramid in order to tackle the process of shifting for large images.
The basic shift-and-match operation was implemented using the circshift() function in MATLAB with the provision of a user-specifiable displacement window. For every shift within the window, the resulting normalized cross-correlation between the two images was stored in a matrix, and the shifts in the x and y directions corresponding to the maximum value of the normalized cross-correlation were used as the final shift values.
For the image pyramid, the images in the three channels were each shrunk down in various levels (each image at the current level being one-half the size of the image at the previous level) for a user-specified number of levels. Starting at the smallest image, the shift-and-match operation was applied and carried through till the final level. At each step, after the shift-and-match operation on the current image in the green and blue channels, the image at the level above was shifted through twice the sum of the current shift with all previous shifts. In order to save memory, the image pyramid was not actually built before hand; in fact each resize and shift was done by computing the correct shift factors only when necessary. The final shift was equivalent to the current shift plus twice the sum of all previous shifts.