dilate_vertical#

rlemasklib.RLEMask.dilate_vertical(up=0, down=0, inplace=False)[source]#

Dilate the mask vertically.

Every foreground pixel causes a given number of its upper and lower neighbors to be set as foreground.

Parameters:
  • up (int) – the number of pixels to dilate upwards

  • down (int) – the number of pixels to dilate downwards

  • inplace (bool) – whether to perform the operation in place or to return a new object

Returns:

The RLEMask object representing the dilated mask (self if inplace=True)

Return type:

RLEMask

Examples

Dilate 1 pixel up and 2 pixels down:

.dilate_vertical(up=1, down=2) ==