1. A method comprising: determining a first registration error between a template image and a source image; warping the source image to compensate for camera motion in response to the first registration error exceeding a registration error threshold; determining a second registration error between the template image and the warped source image; generating a pixel difference mask using the template image; and selectively performing local registration for the source image based on the pixel difference mask in response to the second registration error exceeding the registration error threshold.