# Ting Ting Wu 15-463 Lab 1

result of the big tif image

-->

-->

My function is called colorize and it takes in the path of the input file, and the path of the file you want to write the end image to.

Comparisons

I used the Sum of Squared Differences method to measure how well the 3 channels matched up. I held the Blue channel in place and shifted the Red and Green channels to do this.

Image Pyramid

For each image I create an image pyramid that goes to an image size no smaller than 32 in width. I did this by taking the log2(width) and then subtracted 5 from that. Because at each level it tests moving the image 30 pixels left/right and 30 pixels up/down. So that's just under 32 pixels size.
So it start by resizing all three channels to that minimum size, which means this width is 1/2^k of the original width. We shift the smaller red and smaller green channels around until they match up with the smaller blue pretty well, and then we shift the original 3 channels by 2^k * whatever amount we shifted previously.
After doing that for the coarsest level, we resize the newly shifted 3 original channels again but this time it's twice the size as before and has twice as much detail. We do the same thing as we did for the previous resolution. And we repeat this process until we finally do that for the finest level where we are working with the channels at their actual size.
After the alignment is done, we can concat the 3 channels together into an image. And voila!

Miscellany

I debated about the range to use when shifting the channels to match up. At first, I used -10 to 10 pixels up/down and left/right as a range. Then I used from -height/64 to height/64 vertically and -width/64 to width/64 horizontally at each resolution. That way it varies the range it looks depending on how big the image is.