normalize_intensity#

kikuchipy.pattern.normalize_intensity(pattern: ndarray, num_std: int = 1, divide_by_square_root: bool = False) ndarray[source]#

Normalize image intensities to a mean of zero and a given standard deviation.

Data type is preserved.

Parameters:
pattern

EBSD pattern.

num_std

Number of standard deviations of the output intensities (default is 1).

divide_by_square_root

Whether to divide output intensities by the square root of the image size (default is False).

Returns:
normalized_pattern

Normalized pattern.

Notes

Data type should always be changed to floating point, e.g. float32 with numpy.ndarray.astype(), before normalizing the intensities.