Sergei Mikhailovich Prokudin-Gorskii (1863-1944) traveled Russia and took photographs of everything. He took a picture of the same scene three times using red, green, and blue filter. Later in 1948, his glass plate images were purchased and publicized by the Library of Congess. Three images of the same scene were not perfectly aligned because there could be a movement of his camera while taking pictures. The goal of this project is aligning three color channel images and forming a color image.
Before I apply align algorithm to image, I first crop corners of the images so that they contain less black corners. Exhaustive search is used for lower resolution images (.jpg). Possible displacement ranges from [-15, 15] for both x and y. Base image was blue filter image. I moved green filter and red filter image to align them to blue filter image. For each displacement vector, I computed SSD of moved image with the base image. Then, my exhaustive search method returns the displacement vector with the minimum SSD value.At first, I computed SSD for the entire image. However, computing SSD in borders caused significant noise. Hence, before computing SSD, I cropped 20% of four borders, which means I computed SSD for center 60% of the image.
Green Offset: (2, 5), Red Offset: (3, 12)
Green Offset: (2, -3), Red Offset: (2, 3)
Green Offset: (3, 3), Red Offset: (3, 7)
Image pyramid is used for higher resolution image (.tif). As I did in exhaustive search, I cropped black corners first before aligning them. Image pyramid method downscales the image by a factor of 1/2 until the image is small enough for doing exhaustive search. Then, offset that was obtained by exhaustive search is multiplied by 2. This scaled offset is then used as a starting point for exhaustive search in next level. At first, possible displacement ranged from [-15, 15] as I did in exhaustive search method. However, it took more than 1 minute to process higher resolution image. Hence, I changed range of displacement to [-5, 5]. Since the displacement range decreased, I also set the size of image for the first exhaustive search accoringly. When maximum displacement (5 in this case) becomes more than 5% of height of the image (base case), image is small enough to start exhaustive search.
Green Offset: (4, 25), Red Offset: (-4, 58)
Green Offset: (17, 59), Red Offset: (14, 123)
Green Offset: (17, 41), Red Offset: (23, 89)
Green Offset: (8, 55), Red Offset: (12, 113)
Green Offset: (10, 81), Red Offset: (14, 178)
Green Offset: (27, 51), Red Offset: (37, 108)
Green Offset: (29, 78), Red Offset: (37, 175)
Green Offset: (14, 52, Red Offset: (12, 111)
Green Offset: (6, 43), Red Offset: (32, 86)
Green Offset: (-1, 53), Red Offset: (-12, 105)
When I used a same algorithm for "emir.tif", it did not produce a clean result. Hence, I used green filter instead of blue filter as a base image for "emir.tif".
Blue Offset: (-24, -49), Red Offset: (17, 57)
Green Offset: (1, 3), Red Offset: (1, 8)
Green Offset: (2, 2), Red Offset: (1, 7)
Green Offset: (-94, -29), Red Offset: (-82, 23)
Green Offset: (5, 8), Red Offset: (12, 88)