A method for aligning images includes (1) selecting a pair of overlapping
pixels when two second image are aligned with a camera motion; (2) if
both pixels are edge pixels, incrementing a correlation value between the
two images for the camera motion; (3) if only one of pixels is an edge
pixel, decrementing the correlation value between the two images for the
camera motion; (4) repeating steps (1) to (3) for other pairs of
overlapping pixels in the two images to determine the correlation value
for the camera motion. The method further includes (5) repeating steps
(1) to (4) for other camera motions; (6) selecting camera motions having
large correlation values; (7) determining matched edge counts for members
of the group; (8) selecting the camera motion with the largest matched
edge count; and (8) aligning the two images with the selected camera
motion.