CS194-26 Project1

1. overview:

the project’s main idea is to align R, G, B channels to form a single image. We are going to set displacement based on two score functions: either ssd or ncc.

2. for small .jpg file:

we can simply search for all possible cases in a search space from [-15, 15] which is 31 * 31 for green and blue or red and blue pairs. Then we can simply use np.dstack to stack these three channels to produce the final result. I accidently implement dstack(maybe not the exact same as np.dstack as I didn’t zero out the rolling numbers) AlsO, I implement a crop_border_further function and crop_broder function. The former crop an image by one tenth of the axis = 1 direction for each four corners. The latter hard code the crop process to crop out the white and black border of the original image.

  1. monastery.jpg

    [gx = -3, gy = 2, rx = 3, ry = 2]

  2. cathedral.jpg

    [gx = 5, gy = 2, rx = 12, ry = 3]

  3. tobolsk.jpg

    [gx = 3, gy = 3, rx = 6, ry = 3]

3. for larger .tif files

use the algorithm in the spec called the image pyramid. The processing is done from the coarsest scale and going down the pyramid, updating the displacememt for each level. This is just a slight modification for simple .png update method.

Note: (1). for the emir.tff, I choose to only crop the original image by applying the crop_border function, which makes the image looks much better. (2). tried to use 7 layers first, but it seems to be slow[more than 1 min per .tff image], so lower the pyramid level to 5. (faster and looks pretty the same as the 7 layer ones.)

  1. workshop.tff
    gx, gy, rx, ry: 0 52 -12 104
  2. emir.tff
    gx, gy, rx, ry: 22 32 36 28
  3. three_generations.tff

gx, gy, rx, ry: 14 53 11 112
4. melons.tff

gx, gy, rx, ry: 10 82 13 179
5. onion_church.tff

gx, gy, rx, ry: 26 51 36 108
6. train.tff

gx, gy, rx, ry: 5 42 31 87
7. icon.tff

gx, gy, rx, ry: 17 40 23 89
8. village.tff

gx, gy, rx, ry: 12 65 22 137
9. self_portrait.tff

gx, gy, rx, ry: 28 78 36 176
10. harvesters.tff

gx, gy, rx, ry: 16 59 13 124
11. lady.tff

gx, gy, rx, ry: 9 48 11 112

4. other photos from the Prokudin-Gorskii collection


  1. gx, gy, rx, ry: -5 40 -32 108


  2. gx, gy, rx, ry: 8 35 17 124


  3. gx, gy, rx, ry: -22 52 -55 107


  4. gx, gy, rx, ry: 8 32 3 92