Colorizing the Prokudin-Gorskii Photo Collection
In this project, we implement a program that automatically colorizes digital Prokudin-Gorskii glass plate images. The result is achieved by extracting the three color channel images and properly aligning them through image-processing techniques.
In this preliminary approach, we remove a margin of 15% around the edges of each color channel. We align the channels by searching over a window of displacements (-15, 15) along both axes, scoring each one with an image matching metric. The best score corresponds to the displacement that most accurately colorizes the image. In our program, we run the L2 norm (SSD) and normalized cross-correlation (NCC) metrics with similar results.
For larger images, we implement a more efficient procedure-- the image pyramid. The recursive approach rescales the image down to the coarsest scale, where a single-scale search is run. Once this estimate is returned, we utilize this information to narrow our search in larger images further down the pyramid.
Here are some additional images I picked out from the Library of Congress collection.
For some images, such as emir.tif, the color channels do not align properly. This can be fixed by preprocessing the images with a sobel filter. When we process our color channels based on their sobel filters, we are able to align the channels on their edges and produce an accurate colorization.
For automatic cropping, I utilized the Sobel edge filter to determine where the horizontal and vertical edges are. Then, I determined which lines take up more than a given percentage of the total width/height of the image (this is a parameter which can be adjusted for more aggressive or conservative cropping). The final crop is then decided based on the location of these lines across all three channels. We can see that this results in generally good crops, although there is some color bleeding in a few of the pictures.
For white balancing, I took the middle 92% of pixel values and rescaled the intensity of the pixel values based on these values. We can see that certain white features in the photos below appear brighter, such as the emir's headpiece or the clothes of the harvesters. The shadows also appear darker, as can be seen with the photo of the man sitting in the shadows with the melons.
To automatically increase the contrast of the images, I used adaptive histogram equalization. Adaptive histogram equalization works by looking at a pixel's neighbors in order to set its intensity values. I found it to work better than global histogram equalization, which sometimes resulted in strange looking photos since we are looking at all pixel values across the photo.