Image Pyramid Alignment
The simple alignment algorithm works well for smaller images, but it is very inefficient for larger images. For the large size images, I used image pyramid
alignment algorithm. The high level idea is to shrink the large .tif images into small images, and iteratively enlarge the small images and find the best
displacement vectors on larger images. The details is the following:
Denote the height and the weight of the original image as H and W. Calculate the resize factor as n = log2(min(H, W)/100). Resize the red/green plate and
blue plate with height = H/n and width = W/n. Denote the small red/green plate as s_0, and the small blue plate as t_0.
for i = 0 to n:
compute the best alignment displacement vector d_i = align(s_i, t_i, d_{i-1})
scale up s_i and t_i by a factor of 2
As the images are getting larger in each iteration, shrink the seach window of displacement. I use (-15, 15) for the smallest imagest, and (-3, 3) for all
the other bigger images. At the end of the algorithm, I obtained the best displacement vector for the images of the original size.