CS194-26 Project 1: Colorizing the Prokudin-Gorskii photo collection

Michael Wang

Main Algorithm

1. Images preprocessed by cropping the edges by 15% on each end.

2. For smaller resolution images, I used a brute-force algorithm that shifted the channels using a [-20, 20] offset in both the x and y directions, prioritizing the translation with the largest normalized cross-correlation (NCC). I aligned the red and green channel to the blue channel.

3. For larger resolution images, I used the same [-20, 20] offset, but used the pyramid technique to efficiently find the optimal translations since the brute-force algorithm requires a larger window, which causes the algorithm to run very inefficiently. Additionally, I scaled the images by 0.5 before running it through the pyramid technique since a translation of 20 in either direction on the full-scale image did not affect the NCC as much, but dramatically increased the cost of running the algorithm.

Low Resolution Images (Brute-force)

image
ag: [2, 5] ar: [3, 12]
image
ag: [2, -3] ar: [2, 3]
image
ag: [3, 3] ar: [3, 7]

High Resolution Images (Pyramid Algorithm)

image
ag: [24, 48] ar: [42, 68]
image
ag: [4, 24] ar: [-4, 58]
image
ag: [18, 60] ar: [14, 124]
image
ag: [18, 40] ar: [22, 90]
image
ag: [8, 54] ar: [12, 116]
image
ag: [10, 82] ar: [14, 178]
image
ag: [26, 52] ar: [36, 108]
image
ag: [30, 78] ar: [38, 176]
image
ag: [14, 52] ar: [12, 110]
image
ag: [6, 42] ar: [32, 86]
image
ag: [30, 78] ar: [38, 176]
image
ag: [0, 54] ar: [-12, 106]

Failures and Fixes

For the emir image, the large difference in intensity values between the red and blue channel resulted in NCC favoring an incorrect alignment. To correct for this, I used Canny Edge to preprocess an image, which allowed alignment to be independent of the raw pixel values. The edges proved to be a better feature and correctly aligned the image.

Using Naive Algorithm

image
image
ag: [24, 48] ar: [42, 68]

Using Canny Edge detection

image
image
ag: [24, 48] ar: [40, 106]

Additional Images

image
ag: [-6, 22] ar: [-8, 234]
image
ag: [-2, 40] ar: [-6, 152]
image
ag: [-8, 44] ar: [-36, 98]