CS194-26 Project 1

Rushil Kapadia

Part 1: Exhaustive Search

We were given an input image that contained three slides representing each of the green, blue, and red filter. I used the given code to divide the three filters and started by using the exhaustive search algorithm. In my code, I tried both minimizing the SSD and maximizing the NCC. I found NCC maximization to perform better and continued with those results. The SSD results can be found in my notebook. Furthermore, to improve performance, during maximization of the NCC, I only ran SSD and NCC on the center pixels, not including a window size amount of pixels on each border. This led to optimal results and led to the difference between the NCC and SSD algorithms to be minimal. The runtime for jpg images is almost instantaneous, while the runtime for tiff images is less than a minute. Below are all the images. Notice that we set a window around -20 to 20.

Green: (5,-1) and Red: (12,0)

Green: (-3,1) and Red: (3,0)

Green: (3,2) and Red: (6,0)

Part 2: Image Pyramid

For pyramid search, we created three layers. The first layer was .25 of the original, the second layer was .5 of the original, and the last layer was the original. In the first layer, we set a window size of 25, and for the other ones we set a window size of 2 as with a scaling of 2x, that was all that was needed. I used the NCC algorithm described above on each layer to find optimal offset. It took around 30 seconds to run. Below is the list of final image outputs and displacements. We also played around and found that a green base worked better than a blue base, so we shifted blue and red instead which led to better results.

Red: (33,-5) and Blue: (-23,4)

Red: (59,13) and Blue: (-41,-9)

Red: (65,-3) and Blue: (-59,-10)

Red: (48,5) and Blue: (-42,-16)

Red: (58,-9) and Blue: (-57,6)

Red: (95,3) and Blue: (-83,-4)

Red: (57,10) and Blue: (-52,-22)

Red: (97,7) and Blue: (-73,1)

Red: (57,0) and Blue: (-52,-5)

Red: (47,3) and Blue: (-41,2)

Red: (51,-11) and Blue: (-53,5)

Part 4: Additional Images

I also added 3 additional images taken from the Prokudin-Gorskii collection. These were tiff files and the below are the results of the pyramid search algorithm

Red: (-13,1) and Blue: (23,-4)

Red: (47,2) and Blue: (-31,-2)

Red: (67,6) and Blue: (-58,-26)