resize#

rlemasklib.RLEMask.resize(output_imshape, fx=None, fy=None)[source]#

Resize the mask to a new shape.

It is enough to provide either the output_imshape or the scaling factors fx and fy.

Internally this is implemented as an affine transformation.

Parameters:
  • output_imshape (Optional[Sequence[int]]) – the shape of the output image as (height, width)

  • fx (Optional[float]) – the scaling factor along the horizontal axis

  • fy (Optional[float]) – the scaling factor along the vertical axis

Returns:

A new RLEMask object representing the resized mask.

Return type:

RLEMask