Images of the Russian Empire: Colorizing the Prokudin-Gorskii photo collection
Below are color images processed from Prokudin-Gorskii glass plate images. Prokudin-Gorskii images are a set of three seemingly black and white images taken using red, blue, and green filtering lenses. We align these images on top of one another to create a color image.
I cropped the set of three images so that we have each separate image individually. Then, I find the correct alignment offsets when layering the images on top of one another. I did this with the ssd formula, since after some testing, it seemed to work well with all images except Emir. I "roll" one layer from -15 to 15 (pixels) in the x and y directions, finding the offset with the lowest ssd calculation with respect to another layer. By rolling with offset x, I mean shifting each row in the image matrix by x and rolling the end values back to the front. After calculating the best offsets, we can align the images with greater accuracy.
This strategy works well with small images, but is ineffective on large images since searching from -15 to 15 is not enough. But looking through a larger range is slow. To solve this problem with large images, I use a pyramid speedup strategy where we apply the above algorithm to recursively sized down versions of the original image to find the best offset. I use 5 layers. At each layer, I resize the image by a factor of 0.5. Starting from the smallest layer, we find an offset from -15 to 15, then multiply that value by two when we move up to find the offset in the next layer, and so on.
The main obstacles I faced were dealing with edges and speed. I quickly realized that we needed to crop edges out of the images to achieve a reasonable offset result. For achieving reasonable speed, I make sure we only ever use a maximum of a 1500 by 1500 pixel subset to calculate ssd. Therefore, I always crop the edges before running the ssd calculation, and continually reduce the size of the input until the image is smaller than 1500 by 1500.
Bells and Whistles
I was having trouble with the Emir image in particular. Looking at the glass plate images, this is expected, as the differences in brightness are significant between the different layers. When looking at the output of my algorithm, I could see that the green was aligning well but the red was aligning very poorly (this can be seen from the image below). What I deduced from this was that the difference between the red and blue layers was too great for ssd to work properly. However, the green layer was a great medium. Therefore, for this image, I aligned on green instead of blue.
Note: I believe that edge detection would also work here due to the differences in contrast being similar for each layer.
Below each image is the offsets (x, y) used to align the green and red layers on top of the blue layer.
Green: (2, 5) Red: (3, 12)
Green: (2, -3) Red: (2, 3)
Green: (3, 3) Red: (3, 6)
Below each image is the offsets (x, y) used to align the green and red layers on top of the blue layer (except the bells and whistles Emir).
Green: (2, 34) Red: (5, 98)
Emir (before bells and whistles)
Green: (24, 48) Red: (-795, 145)
Emir (after bells and whistles)
Green: (17, 57) Red: (-24, -48)
Green: (17, 59) Red: (14, 123)
Green: (18, 41) Red: (23, 90)
Green: (8, 52) Red: (12, 112)
Green: (9, 82) Red: (12, 178)
Green: (26, 50) Red: (37, 108)
Green: (29, 77) Red: (37, 175)
Green: (14, 51) Red: (12, 110)
Green: (7, 42) Red: (33, 86)
Green: (-1, 52) Red: (-12, 105)
Below each image is the offsets (x, y) used to align the green and red layers on top of the blue layer. These are images I chose from the Prokudin-Gorskii collection online. The first two are small, the last two are large.
Green: (-4, 8) Red: (-7, 11)
Green: (-1, 5) Red: (-3, 9)
Green: (4, 51) Red: (-5, 105)
Green: (33, 57) Red: (49, 130)