CS194-26 Project 1

By Kevin Li


In this project, our task was to create a single colored-image using three images of different color channels that are stacked on to op one another. To complete this task, we utilized techniques and algorithms to translate the images so that the images aligned on top of one another to create a single image combining the three color channels.


My approach to aligning the three images was…

  1. IF the image is small and compressed (ie. jpg files), use iteration to determine the translation that generates the smallest sum of squared distance(our metric to determine the accuracy of the aligned image)
  2. OTHERWISE depending on the size of the image, we determine how many times we downscale an image (by a factor of 2) and use recursion to continue to downsize until we hit the base case. (Image Pyramid)
  3. Solve the smallest sum of squared distance for the base case and pass the result up until we have finished the recusion process.
  4. In essence we are starting from the top of the pyramid and search for the best displacement and pass that displacement down to the next layer of the pyramid.


While working on this project one challenge that I encountered was my lack of familiarity with both Python and Matlab. Since this was my first major project where I had to use Python, it took quite a while to set up my Python and Jupyter Notebook environment. Also, I spent a lot of time trying to get familiar with the different Python tools at my disposal (such as skimage) and learning how to utilize them effectively. As a result, I spent a lot of time tinkering with the different libraries and using a lot of trial and error.
Another challenge that I encountered was dealing with images that were lighter in tone (ie. melons.tif and workshop.tif). Specifically in the melons.tif image, the image was naturally lighter in comparison with the other example images and this led to the melons being drastically different shades in each of the 3 color channels. I believe that this drastic contrast between the melons in the images led to a higher SSD when aligning the dark melons in the red color-channel image with the naturally dark stand in the blue color-channel image.

Example Images

To demonstrate the effectiveness of my approach, here are my results on some of the example images that we were given.

G: [3, 0]
R: [9, 2]

G: [3, 2
R: [7, 4]

G: [32, 2]
R: [97, 4]

G: [-1, 33]
R: [57, 50]

G: [52, 0]
R: [-43, -38]

G: [42, 6]
R: [85, 32]

G: [48, 16]
R: [109, 11]

G: [102, 49]
R: [107, 0]

G: [58, 18]
R: [122, 17]

G: [77, 29]
R: [129, 29]

G: [50, 26]
R: [108, 37]

G: [48, 7]
R: [107, 11]

G: [48, 18]
R: [96, 23]

Self-Selected Images

G: [38, 14]
R: [73, 14]

G: [37, 33]
R: [92, 58]

G: [39, -2]
R: [-42, -13]

G: [18, -7]
R: [65, -5]