mapchete_eo.image_operations.linear_normalization

mapchete_eo.image_operations.linear_normalization(bands: ~numpy.ma.MaskedArray, bands_minmax_values: ~typing.Tuple[~typing.Tuple[int, int], ~typing.Tuple[int, int], ~typing.Tuple[int, int]] = ((5, 3350), (0, 3150), (0, 3200)), out_dtype: ~numpy.dtype[~typing.Any] | None | type[~typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | str | tuple[~typing.Any, int] | tuple[~typing.Any, ~typing.SupportsIndex | ~collections.abc.Sequence[~typing.SupportsIndex]] | list[~typing.Any] | ~numpy._typing._dtype_like._DTypeDict | tuple[~typing.Any, ~typing.Any] = <class 'numpy.uint8'>, out_min: int | None = None) MaskedArray[source]

Scale and normalize bands to individual minimum and maximum values.

From eox_preprocessing.image_utils

See: https://en.wikipedia.org/wiki/Normalization_(image_processing)

Parameters:
  • bands (np.ndarray) – Input bands as a 3D array.

  • bands_minmax_values (list of lists) – Individual minimum and maximum values for each band. Must have the same length as number of bands.

  • out_min (float or int) – Override dtype minimum. Useful when nodata value is equal to dtype minimum (e.g. 0 at uint8). In that case out_min can be set to 1.

Returns:

scaled bands

Return type:

ma.MaskedArray