1. A method of aligning a pair of original images, the method comprising: defining a plurality of different pairs of images at a plurality of different resolutions; and hierarchically aligning the pair of original images by first aligning the pair of images at the lowest resolution and then aligning each pair of images at each higher resolution based on the alignments of the pair of images at the lower resolutions, the hierarchical aligning comprising, for each particular resolution in a subset of resolutions: in at least one image at the particular resolution, identifying portions that are suitable for performing the alignment and portions that are not suitable for performing the alignment; and comparing the pair of images at the particular resolution by using the suitable portions while excluding the unsuitable portions from the comparison.