Welcome to My CS180 Project 1 Portfolio!

Sergei Mikhailovich Prokudin-Gorskii's pictures

Prokudin-Gorskii has produced pictures through BGR filters (in order). This project tries to build colorful images which Prokudin-Gorskii did not have the chance to print.

Part 1: Exhaustive search
Part 2: Pyramid search (and self-select images)
Part 3 (Bells and Whistles) cv.sobel on Emir

Part 1: Exhaustive search

I first approach each of the image by trying out all displacements from x and y coordinates with the range of [-15, 15], with metrics of l2 norm and normalized cross correlation(ncc). However, the borders often interfere with the metrics so I decide to crop the 7.5% from each side. The results are good in ncc metric.

exhaustive search
Cathedral. Displacement: G: [5, 2] Displacement: R: [12, 3]
exhaustive search
Monastery. Displacement: G: [-3, 2] Displacement: R: [3, 2]
exhaustive search
Tobolsk. Displacement: G: [3, 3] Displacement: R: [6, 3]

Part 2: Pyramid search

Pictures above were all in jpg form so the runtimes for aligning were low. However, we have some very big files in tif forms so we need to implement a faster algorithms: pyramid. The pyramid method, in its nature, is also doing searching. Instead of performing exhaustive search, it begins searching from a blurry picture to reduce the amount of pixels processed. When the first level of blurry images are aligned(using the regular alignment function), we get to the second level with finer images and the displacements we received from the first level. This is a recursive algorithm and is ~4 times faster than exhaustive search.

pyramid search
Church. Displacement: G: [25 4] Displacement: R: [58 -4]
pyramid search
Emir. Displacement: G: [49 24] Displacement: R: [ 104 -154] (This one is bad and we will come back to this)
pyramid search
harvesters. Displacement: G: [60 17] Displacement: R: [124 14]
pyramid search
Icon. Displacement: G: [40 17] Displacement: R: [90 23]
pyramid search
Lady. Displacement: G: [48 9] Displacement: R: [112 12]
pyramid search
Melons. Displacement: G: [82 10] Displacement: R: [179 14]
pyramid search
Onion church. Displacement: G: [51 26] Displacement: R: [108 36]
pyramid search
Sculpture. Displacement: G: [ 33 -11] Displacement: R: [140 -27]
pyramid search
Self portrait. Displacement: G: [80 29] Displacement: R: [176 36]
pyramid search
Three generations. Displacement: G: [54 14] Displacement: R: [112 11]
pyramid search
Train. Displacement: G: [42 6] Displacement: R: [87 32]


Then, I have some self select images

pyramid search
Train. Displacement: G: [32 4] Displacement: R: [80 7]
pyramid search
Train. Displacement: G: [35 3] Displacement: R: [98 4]
pyramid search
Train. Displacement: G: [26 18] Displacement: R: [121 34]

Part 3: Emir

Emir is a special case. The pyramid search did not work well on this image. That's because The Emir's blue jacket captures a lof of light in the blue channel but not so much in the green and red channels What work previously does not work now. My approach is to use Sobel operator on the original raw image first and then try to use pyramid method to align the Sobel'ed image.

emir
Pyramid-aligned Emir. Displacement: G: [49 24] Displacement: R: [ 104 -154]

After I apply cv.sobel to emir image and align the sobel images, I get this

emir_sobel

With the offsets from the sobel images, I can now apply the offsets to the original image.

emir_aligned
Sobel-aligned Emir. Displacement: G: [49 23] Displacement: R: [107 40]