The input image is split into three parts using the starter code. The algorithm I used to find the x,y displacements is NCC. Using the green base, I first found the norm across the x-axis for the blue filter and green filter, then applied a rolling window [-20, 20] pixels that rolled the image on the x-axis. I found the maximum dot product of the entire image using the norms aforementioned and saved the x displacement. I then applied the x-displacement, rolled the image, and repeated this process for the y-axis. This is necessary as a two-step process, as the y-displacement is optimized when the x-displacement is already applied to the image. I used the same process for the blue filter with the red filter. This method works great for jpg files, but tiff files are bounded by the small rolling window. The runtime for jpg images are around .30 seconds, while the runtime for tiff images are around 13 seconds. Below is just cathedral.jpg and emir.tif for brevity. Notice that for the large tiff files, the most displacements are cutoff at -20 or 20.
Blue (x,y) displacement: (7, 1), Red (x,y) displacement: (-5, -2)
Blue (x,y) displacement: (20, 14), Red (x,y) displacement: (-15, -18)