crop#
- rlemasklib.RLEMask.crop(bbox, inplace=False)[source]#
Crop the mask to the bounding box.
- Parameters:
bbox (ndarray) – a bounding box, in the format [x_start, y_start, width, height]
inplace – whether to perform the operation in place or to return a new object
- Returns:
An RLEMask object representing the cropped mask.
- Return type:
Examples
Crop to a 4x3 region starting at (x=2, y=1):
.crop([2, 1, 4, 3]) ==See also