imglp.drift module
- imglp.drift(image, image2, /, drift_max=None, *, do_hp=True, do_contrast_norm=False, fact=1, 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 calculates the drift between two close images.
- Parameters:
image (numpy.ndarray or cupy.ndarray) – first image to use.
image2 (numpy.ndarray or cupy.ndarray) – second image to use.
drift_max (float) – maximum drift in pixels.
do_hp (bool) – True to apply high-pass filtering on images to avoid calculating drift on background
do_contrast_norm (bool) – True to apply a contrast normalization making each local pic the same intensity
fact (float) – factor to apply to change maximum drift.
xp (numpy or cupy) – if cupy will calculate on GPU
- Returns:
dx (float) – drift in x : x1 = x0 + dx [pix].
dy (float) – drift in y : y1 = y0 + dy [pix].
Examples
>>> from imglp import drift ... >>> dx, dy = drift(img1, img2) # TODO