To avoid the bad effect by the border of images, I manually cut off 15% of the image on the border. (10% for emir.tif because 15% produces a bad outcome)
For Single-scale implementation, I exhaustively searched over [-15, 15] pixels for both x and y axis, and return the best offset with the smallest Euclidean Distance, which indicates good alignment.
Based on the Single-Scale implementation, I employed an image pyramid of level 3 to improve the efficiency of aligning. For base case of level 0, use single-scale implementation to find best offset with smallest Euclidean Distance. For higher levels, the image is downscaled by a factor of 2, then the function is recursively called to find best offset in lower resolution. Based on the best shift at lower resolution, that shift is scaled up and refined with another single-scale search at the original resolution.
cathedral.jpg
church.tif
emir.tif
harvesters.tif
icon.tif
lady.tif
melons.tif
monastery.jpg
onion_church.tif
sculpture.tif
self_portrait.tif
three_generations.tif
tobolsk.jpg
train.tif
Offset G: (5, 2), Offset R: (12, 3)
Offset G: (25, 4), Offset R: (58, -4)
Offset G: (49, 24), Offset R: (103, 55)
Offset G: (59, 17), Offset R: (123, 13)
Offset G: (41, 17), Offset R: (89, 23)
Offset G: (52, 8), Offset R: (113,11)
Offset G: (81, 10), Offset R: (178, 13)
Offset G: (-3, 2), Offset R: (3, 2)
Offset G: (51, 27), Offset R: (108, 36)
Offset G: (33, -11), Offset R: (140, -27)
Offset G: (78, 29), Offset R: (176, 37)
Offset G: (52, 13), Offset R: (111, 11)
Offset G: (3, 3), Offset R: (6, 3)
Offset G: (42, 6), Offset R: (87, 32)