Image Cross-Correlation and Interlacing

A module that provides algorithm for creating sub-pixel cross-correlation images and computing displacements.

Author

Mihai Cara (for help, contact HST Help Desk)

License

LICENSE

subpixal.cc.find_displacement(ref_image, image00, image10, image01, image11, cc_type='NCC', full_output=False)[source]

Find subpixel displacements between one reference cutout and a set of four “dithered” cutouts. This is achieved by finding peak position in a “supersampled” cross-correlation image obtained by interlacing cross-correlation maps of reference cutout with each dithered cutout.

Parameters
ref_imagenumpy.ndarray

Image of a reference cutout.

image00numpy.ndarray

Image whose displacement relative to reference image needs to be computed. It must have same shape as ref_image.

image10numpy.ndarray

“Same” image as image00 but sampled at a 1/2 pixel displacement along the X-axis. It must have same shape as ref_image.

image01numpy.ndarray

“Same” image as image00 but sampled at a 1/2 pixel displacement along the Y-axis. It must have same shape as ref_image.

image11numpy.ndarray

“Same” image as image00 but sampled at a 1/2 pixel displacement along both X-axis and Y-axis. It must have same shape as ref_image.

cc_type{‘CC’, ‘NCC’, ‘ZNCC’}, optional

Cross-correlation algorithm to be used. 'CC' indicates the “standard” cross-correlation algorithm. 'NCC' refers to the normalized cross-correlation and 'ZNCC' refers to the zero-normalized cross-correlation, see, e.g., Terminology in image processing.

full_outputbool, optional

Return displacements only (full_output=False) or also interlaced cross-correlation image and direct (non-interlaced) cross-correlation images

Returns
dxfloat

Displacement of image00 with regard to ref_image along the X-axis (columns).

dyfloat

Displacement of image00 with regard to ref_image along the Y-axis (rows).

iccnumpy.ndarray, Optional

Interlaced (“supersampled”) cross-correlation image. Returned only when full_output is True.

ccslist of numpy.ndarray, Optional

List of cross-correlation images between ref_image and image??. Returned only when full_output is True.