linumpy.utils_images#

Functions#

normalize(img[, saturation])

Normalize an image between 0 and 1.

get_overlay_as_rgb(img1, img2)

Combine the two images into a single RGB image.

match_shape(img1, img2)

Match the shape of two images by padding the smallest one.

display_overlap(img1, img2[, title, do_normalization])

apply_xy_shift(img, reference, dx, dy)

Apply a shift to the image in the xy plane.

Module Contents#

linumpy.utils_images.normalize(img, saturation=99.7)[source]#

Normalize an image between 0 and 1.

Parameters.#

imgnp.ndarray

The image to normalize.

saturationfloat, optional

The saturation value for the normalization

returns:

The normalized image.

rtype:

np.ndarray

Parameters:
Return type:

numpy.ndarray

linumpy.utils_images.get_overlay_as_rgb(img1, img2)[source]#

Combine the two images into a single RGB image.

Parameters.#

img1np.ndarray

The first image.

img2np.ndarray

The second image.

returns:

The overlay image.

rtype:

np.ndarray

Parameters:
Return type:

numpy.ndarray

linumpy.utils_images.match_shape(img1, img2)[source]#

Match the shape of two images by padding the smallest one.

Parameters.#

img1np.ndarray

The first image.

img2np.ndarray

The second image.

returns:

The two images with the same shape.

rtype:

Tuple[np.ndarray, np.ndarray]

Parameters:
Return type:

tuple[numpy.ndarray, numpy.ndarray]

linumpy.utils_images.display_overlap(img1, img2, title=None, do_normalization=False)[source]#
Return type:

None

linumpy.utils_images.apply_xy_shift(img, reference, dx, dy)[source]#

Apply a shift to the image in the xy plane.

Parameters:
  • img (np.ndarray) – The image to shift.

  • reference (np.ndarray) – The reference image.

  • dx (int) – The shift in x.

  • dy (int) – The shift in y.

Return type:

numpy.ndarray