imglp.crosscorrelate module

imglp.crosscorrelate(image, image2=None, /, *, out=None, cropshape=None, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/imglp/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>)[source]

This function will calculated the image crosscorrelation between two images.

Parameters:
  • image (numpy.ndarray or cupy.ndarray) – First image to use.

  • image2 (numpy.ndarray or cupy.ndarray) – Second image to use, if None will calculate autocorrelation.

  • out (numpy.ndarray or cupy.ndarray) – Output array, if None will be initialized automatically.

  • cropshape (tuple) – shape to use for output, if smaller than shape of images, will correspond to the middle crop

  • xp (numpy or cupy) – if cupy, will calculate on GPU

Returns:

out – Crosscorrelation image [cropped].

Return type:

numpy.ndarray or cupy.ndarray

Examples

>>> from imglp import crosscorrelate
...
>>> out = crosscorrelate(img1, img2)