CS194-26, Fall 2021

Programming Project 1

Jaeyoung Park



1. Overview

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.



2. Exhaustive Search

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.



Cathedral

Green Offset: (2, 5), Red Offset: (3, 12)



Monastery

Green Offset: (2, -3), Red Offset: (2, 3)



Tobolsk

Green Offset: (3, 3), Red Offset: (3, 7)



3. Image Pyramid

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.

<3-1. Blue as a reference>

Moved red and green filter image to align them to blue filter image



Church

Green Offset: (4, 25), Red Offset: (-4, 58)



Harvester

Green Offset: (17, 59), Red Offset: (14, 123)



Icon

Green Offset: (17, 41), Red Offset: (23, 89)



Lady

Green Offset: (8, 55), Red Offset: (12, 113)



Melons

Green Offset: (10, 81), Red Offset: (14, 178)



Onion_church

Green Offset: (27, 51), Red Offset: (37, 108)



Self_portrait

Green Offset: (29, 78), Red Offset: (37, 175)



Three_generations

Green Offset: (14, 52, Red Offset: (12, 111)



Train

Green Offset: (6, 43), Red Offset: (32, 86)



Workshop

Green Offset: (-1, 53), Red Offset: (-12, 105)



<3-2. Green as a reference>

Moved red and blue filter image to align them to green filter image

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".



Emir

Blue Offset: (-24, -49), Red Offset: (17, 57)



4. Other Images

<4-1. Exhaustive Search>



Field

Green Offset: (1, 3), Red Offset: (1, 8)



Building

Green Offset: (2, 2), Red Offset: (1, 7)



<4-2. Image Pyramid>



Forest

Green Offset: (-94, -29), Red Offset: (-82, 23)



Village

Green Offset: (5, 8), Red Offset: (12, 88)