Programming Project #1
15-863: Computational Photography
Ashique KhudaBukhsh

Images of the Russian Empire:
Colorizing the Prokudin-Gorskii photo collection
Due Date: 11:59pm on Friday, September 16, 2010

Background

Prokudin-Gorskii, a visionary, was way ahead of his time; he explored an innovative idea of constructing color photographs by combining red, green and blue channels to create a colorized photograph as output. In this project, I have tried to reconstruct color pictures using some of the pictures he took.

Before combining the image, I had to align each channels properly. For smaller image, I was using a window of [-15,15] and compared a pair of channels. I used SSD as the metric to detect good matches. For larger images, I used a Gaussian Pyramid technique and started from a very coarse level. For each level, I kept on updating the window size.

Also, I had a graduate component in my assignment. The Hybrid project can be found at
  • graduate component
  • Bells and Whistles

    I implemented autocropping in the following way: I assumed that a good photographer will try to place interesting objects along the 1/3rd and 2/3rd for the vertical and horizontal line (rule of thirds in photography).

    I sampled the 1/3rd and 2/3rd vertical and horizontal lines and computed how much the channels disagree. I used a simple metric where I computed the sum of the squares of difference in pair of channels. A small value is desirable; higher values mean that the pixels don't agree well. For larger pictures I started with a conservative boundary of 250 pixels of cropsize in each direction and gradually reducing the boundary. I stopped at the moment I found the difference is above a given threshold.

    This method can be further stabilized by randomly sampling more horizontal and vertical lines and computing the vertical and horizontal cropsizes for each of them, and then taking an average.

    After this, I sharpened the image using the technique taught in the class.

    Issues

    Although I implemented autocropping as a postprocessing step, in order to have a better alignment of each channels, I started with a cropped version of images of each of the channels. I did this because initially I was having problems with aligning the image. Since the pixel values close to the border of the image do not agree well, removing them helped me to find out a better alignment. Once I calculated the alignment, I used circshift() to align the channels. For autocropping, I used the uncropped, aligned version images from each channel.

    Low-res images


    Before




    After



    Green = [3,3]
    Red = [4,5]







    Before




    After



    Green = [4,1]
    Red = [9,-1]







    Before




    After



    Green = [6,6]
    Red = [11,8]







    Before




    After



    Green = [2,3]
    Red = [5,5]







    Before




    After



    Green = [6,1]
    Red = [12,0]







    Before




    After



    Green = [2,2]
    Red = [4,3]







    Before




    After



    Green = [3,1]
    Red = [15,15]







    Before




    After



    Green = [1,-1]
    Red = [13,-1]







    Before




    After



    Green = [1,1]
    Red = [4,2]







    Before




    After



    Green = [6,2]
    Red = [14,4]

    High-res images can be found at the following links

    Acknowledgement

    I used the webpage of Natasha, our TA, to format my submission.