max_pool2x2#

rlemasklib.RLEMask.max_pool2x2(inplace=False)[source]#

Max-pool the mask by a factor of 2.

Each 2x2 block in the input produces a single pixel in the output, which is 1 if any pixel in the block is 1.

Parameters:

inplace – whether to perform the operation in place or to return a new object

Returns:

An RLEMask object representing the max-pooled mask.

Return type:

RLEMask

Examples

.max_pool2x2() ==