slmsuite.holography.analysis.image_normalize
- image_normalize(images, nansum=False, remove_field=False)[source]
Normalizes of a stack of images via the the zeroth order moments.
- Parameters
images (numpy.ndarray) – A matrix in the style of the output of
take()
, with shape(image_count, h, w)
, where(h, w)
is the width and height of the 2D images andimage_count
is the number of images. A single image is interpreted correctly as(1, h, w)
even if(h, w)
is passed, though the returned image remains shape(h, w)
in that case.nansum (bool) – Whether to use
numpy.nansum()
in place ofnumpy.sum()
.remove_field (bool) – Whether to apply
image_remove_field()
to avoid background-dominated moments.
- Returns
images_normalized – A copy of
images
, with each image normalized.- Return type
numpy.ndarray