Fall 2018
CS194-26: Image Manipulation and Computational Photography

Grace Park
SID: 3032341209
cs194-26-acd

Project 1: Colorizing the Prokudin-Gorskii Photo Collection


Purpose

The project goal was to process the photos from Sergei Mikhailovich Prokudin-Gorskii's black and white photos, taken using RGB glass plates, into colored photos.
​ (More information on Prokudin-Gorskii: http://www.loc.gov/exhibits/empire/gorskii.html)

Figure 1: Result of the Colorized Image, Emir.tif


Part1: Using SSD (Sum Squared Differences) for Alignment

The most important part of this project was to align the three digitized glass plate images, each corresponding to RGB. For this project, a program written python was used to process the photos.

Figure 2: Digitized RGB Glass Plate Images, monastery.jpg

The input of the program is an image as shown in Figure 2. From the top, the image corresponds to glass plate image of blue, green, and red. Once the three images are stacked as a n x m x 3 matrix, the image looks like Figure 3.

Figure 3: Stacked RGB Images, monastery.jpg

Afterwards, the image is cropped at the border since alignment can have problems with the borders. The result would look like Figure 4. This is done by removing 10% o the image from each side.

Figure 4: Stacked RGB Images Cropped Borders, monastery.jpg

The SSD is implemented by finding the best alignment of the image within -15 to 15 pixel from horizontal and vertical direction. While the G image stays still, R and B image is moved to minimize SSD.
The final result of the colorized photo is shown in Figure 5, where R has an offset of (6, 1) and B has an offset of (3, -2) respective to G.

Figure 5: Stacked RGB Images Cropped Borders, monastery.jpg



Part2: Using Image Pyramid for High Resolution Photos

Since SSD can take a long time for high resolution images, image pyramid is used for large photos. Below, Figure 6 is the initial stacked train.tif.

Figure 6: Stacked Image, train.tif

The image pyramid function recursively calls itself and lowers the resolution of the image until the image is small enough to use SSD. Figure 7 shows the result of the image pyramid resulting in the alignment of the train.tif.

Figure 7: Colorized Image, train.tif



Side Note:
One problem that took a long time for me to figure out happened while I was implementing the image pyramid. I was using imresize function from the python library scipy. However, as shown in Figure 8, the image would not align even in the base case of the image pyramid recursive function.

Figure 8: SSD Failing, lady.tif

When the resizing function was changed to transform.rescale function from the python library skimage, I was able to get the right alignment.

Figure 9: Colorized Image, lady.tif

I'm still unclear why imresize function failed in the SSD image alignment since the image seemed to be successfully resized.


Resulting Colorized Photos:
Below are all of the photos provided by the instructor that were colorized using the program. The offset of R and B are included.

Figure 10: Colorized Image, cathedral.jpg
R_offset: (7, 1), B_offset: (-5, -2)


Figure 11: Stacked RGB Images Cropped Borders, monastery.jpg
R_offset: (6, 1), B_offset: (3, -2)


Figure 12: Colorized Image, nativity.jpg
R_offset: (4, -1), B_offset: (-3, -1)


Figure 13: Colorized Image, settlers.jpg
R_offset: (8, -1), B_offset: (-7, 0)


Figure 14: Result of the Colorized Image, Emir.tif
R_offset: (57, 17), B_offset: (-49, -24)


Figure 15: Colorized Image, harvesters.tif
R_offset: (65, -3), B_offset: (-59, -16)


Figure 16: Colorized Image, icon.tif
R_offset: (48, 5), B_offset: (-41, -17)


Figure 17: Colorized Image, lady.tif
R_offset: (61, 3), B_offset: (-51, -9)


Figure 18: Colorized Image, self_portrait.tif
R_offset: (98, 8), B_offset: (-78, -29)


Figure 19: Colorized Image, three_generations.tif
R_offset: (58, -3), B_offset: (-53, -14)


Figure 20: Colorized Image, train.tif
R_offset: (43, 27), B_offset: (-42, -5)


Figure 21: Colorized Image, turkmen.tif
R_offset: (60, 7), B_offset: (-56, -21)


Figure 22: Colorized Image, village.tif
R_offset: (73, 10), B_offset: (-64, -12)




Last Edit: 9/5/2018