Project 1 - Images of the Russian Empire

For this project, the goal was to use the digitized Prokudin-Gorskii glass plate images, and, using image processing techniques, automatically produce a full-color image (variety of image sizes and formats - .jpg and .tif). Individually, I began by attempting a naive solution of translating one image onto another, trying all possible horizontal/vertical translation combinations of 30 pixels or less each way. This approach worked well for small images, but for larger images, this approach proved to be insufficient, as larger translations were often required, but searching a larger space of translations would take excessive runtime. In order to mitigate this issue, I leveraged an image pyramid, through which I began by downsampling (averaging) the larger images into images of around 200x200 pixels, and finding the best possible translation for this case. I then gradually downsampled the image less and searched a smaller space of possible translations (previous downsamples already reduced the search space significantly), increasing pixels by a factor of 2 each sample, both horizontally and vertically. Through this approach, I ended up with very clear full-color versions of both small and large images, and the runtime was efficient (O(N^2), where N is number of horizontal/vertical pixels). One issue that I ran into was that originally, my alignment strategy was to convolute images, through which I'd end up taking slightly cropped versions of images, which wouldn't work well with the image pyramid strategy. Instead, I decided to use the convolution to obtain the best shift, and then use this shift to roll images, through which I preserved image size and was able to easily implement the pyramid. Another issue I ran into was when I was using the Euclidean distance between two images as criteria for finding the best shift, this wasn't producing the best images compared to looking at structural similarity, so I switched to ssim instead.

Cathedral
Cathedral
Cropped: 12 top, 22 bottom, 13 left, 19 right.
Red Image: (-10, 3) shift. Green Image: (-6, 2) shift.
Church
Church
Cropped: 70 top, 55 bottom, 41 left, 90 right.
Red Image: (-24, -4) shift. Green Image: (-16, 4) shift.
Emir
Emir
Cropped: 133 top, 218 bottom, 201 left, 146 right.
Red Image: (-129, 40) shift. Green Image: (-67, 22) shift.
Harvesters
Harvesters
Cropped: 92 top, 161 bottom, 63 left, 189 right.
Red Image: (-43, 12) shift. Green Image: (24, 14) shift.
Icon
Icon
Cropped: 52 top, 122 bottom, 63 left, 137 right.
Red Image: (-27, 23) shift. Green Image: (-19, 16) shift.
Lady
Lady
Cropped: 99 top, 148 bottom, 165 left, 127 right.
Red Image: (-44, 12) shift. Green Image: (-25, 8) shift.
Melons
Melons
Cropped: 197 top, 131 bottom, 175 left, 224 right.
Red Image: (-39, 12) shift. Green Image: (-21, 10) shift.
Monastery
Monastery
Cropped: 13 top, 15 bottom, 12 left, 15 right.
Red Image: (-15, 2) shift. Green Image: (-12, 2) shift.
Onion Church
Onion Church
Cropped: 132 top, 121 bottom, 104 left, 135 right.
Red Image: (-60, 35) shift. Green Image: (-32, 25) shift.
Sculpture
Sculpture
Cropped: 111 top, 119 bottom, 101 left, 115 right.
Red Image: (-12, -27) shift. Green Image: (-43, -11) shift.
Self
Self Portrait
Cropped: 185 top, 238 bottom, 292 left, 110 right.
Red Image: (-105, 36) shift. Green Image: (-61, 29) shift.
Three
Three Generations
Cropped: 107 top, 119 bottom, 121 left, 93 right.
Red Image: (-36, 9) shift. Green Image: (-17, 15) shift.
Tobolsk
Tobolsk
Cropped: 9 top, 20 bottom, 18 left, 18 right.
Red Image: (-12, 3) shift. Green Image: (-6, 3) shift.
Image 14
Train
Cropped: 74 top, 110 bottom, 67 left, 159 right.
Red Image: (-35, 29) shift. Green Image: (-21, 7) shift.
Image 14
Prokudin Image One
Image 14
Prokudin Image Two
Image 14
Prokudin Image Three
Image 14
Prokudin Image Four

Bells and Whistles

Extra Image 1
Melons without Cropping
Extra Image 2
Melons with Cropping

For Bells and Whistles, I decided to attempt automated border cropping for the original images. I tried a variety of techniques, including using the mean pixel value and trying to only remove white borders, and eventually figured out a strategy for removing most of the white and black borders by using the percentage of pixels surpassing some value threshold as a metric for whether a row/column was a border row/column. Above is an example demonstrating the power of this technique on Melons.