skued.mask_image

skued.mask_image(image, mask, fill_value=0, copy=True)

Fill invalid pixels in an image with another value, according to a pixel mask. While this function has simply functionality, it is ideal for integrating into a pipeline with functools.partial.

Parameters:
  • image (~numpy.ndarray) –

  • mask (~numpy.ndarray) – Boolean array. mask should evaluate to True on valid pixels.

  • fill_value (float, optional) – Invalid pixels fill value.

  • copy (bool, optional) – If True (default), image is copied before masking. If False, image is modified in-place.

Returns:

masked – Masked image. If copy = True, masked points to the same object as image.

Return type:

~numpy.ndarray