register_images

image_registration.register_images.register_images(im1, im2, usfac=1, return_registered=False, return_error=False, zeromean=True, DEBUG=False, maxoff=None, nthreads=1, use_numpy_fft=False)[source]

Sub-pixel image registration (see dftregistration for lots of details)

Parameters:
im1np.ndarray
im2np.ndarray

The images to register.

usfacint

upsampling factor; governs accuracy of fit (1/usfac is best accuracy)

return_registeredbool

Return the registered image as the last parameter

return_errorbool

Does nothing at the moment, but in principle should return the “fit error” (it does nothing because I don’t know how to compute the “fit error”)

zeromeanbool

Subtract the mean from the images before cross-correlating? If no, you may get a 0,0 offset because the DC levels are strongly correlated.

maxoffint

Maximum allowed offset to measure (setting this helps avoid spurious peaks)

DEBUGbool

Test code used during development. Should DEFINITELY be removed.

Returns:
dx,dyfloat,float

REVERSE of dftregistration order (also, signs flipped) for consistency with other routines. Measures the amount im2 is offset from im1 (i.e., shift im2 by these #’s to match im1)