Objective: The goal for this project was to generate color images by aligning RGB filtered glass plate images from the Prokudin-Gorskii photo collection.
Algorithm: There are two methods called Sum of Squared Differences (SSD) and Normalized Cross Correlation (NCC) that can each find the minimum displacement between two images. The minimum displacement corresponds to the best picture alignment. For small pictures, I iterated over rows and columns in the image and used SSD on a window of 30 pixels to find the minimum displacement. For larger images, I implemented a faster algorithm that used the pyramid approach, which involves scaling the image and then applying SSD to a small window around an area within the scaled image corresponding to the smallest displacement. For both algorithms, I rolled the images based on the calculated minimum displacement and then stacked the rolled images to generate the final colored picture. To ensure greater picture clarity, I decided to crop 5% of the image before using the SSD function.
Results: The image collection below represents the results from running the pyramid algorithm, and the displacements are listed below each image. Most of the images are aligned with Blue as the base, but a few of the images, such as Emir and Self-Portrait, are aligned with Green as the base, as that improved image quality.
JPG Files |
|
CATHEDRAL Green = [5,2] Red = [12,3] View full-size size image |
MONASTERY Green = [-3,2] Red = [3,2] View full-size size image |
NATIVITY Green = [3,1] Red = [7,1] View full-size size image |
SETTLERS Green = [7,0] Red = [14,-1] View full-size size image |
TIF Files |
||
EMIR Blue = [-49,-24] Red = [57,17] View full-size size image |
HARVERSTERS Green = [60,16] Red = [124,14] View full-size size image |
ICON Green = [41,17] Red = [89,23] View full-size size image |
LADY Green = [55,4] Red = [110,2] View full-size size image |
SELF PORTRAIT Blue = [-70,-24] Red = [98,7] View full-size size image |
THREE GENERATIONS Green = [54,13] Red = [112,10] View full-size size image |
TRAIN Green = [42,3] Red = [87,31] View full-size size image |
TURKMEN Green = [57,19] Red = [114,26] View full-size size image |
VILLAGE Green = [65,12] Red = [138,23] View full-size size image |
ADDITIONAL PICTURES |
||
CASTLE WALL Blue = [-6,1] Red = [7,-2] View full-size size image |
ONION CHURCH Blue = [-52,25] Red = [57,11] View full-size size image |
PAINT ROOM Blue = [-70,-20] Red = [74,5] View full-size size image |
RIVER VILLAGE Blue = [-62,3] Red = [72,-19] View full-size size image |
SIBERIAN RAILWAY Blue = [-1,1] Red = [5,1] View full-size size image |
LAKE VILLAGE Blue = [-49,19] Red = [52,9] View full-size size image |