intersection#

static rlemasklib.RLEMask.intersection(masks)[source]#

Return a mask where each pixel is set if and only if all input masks have the pixel set.

Parameters:

masks (Sequence[RLEMask]) – a list of RLEMask objects

Returns:

A new RLEMask object representing the intersection of the masks.

Return type:

RLEMask

Examples

Only the region where all three masks overlap survives:

RLEMask.intersection([, , ]) ==

See also

__and__(), which provides the intersection as the & operator. merge_many(), which allows merging with different binary Boolean functions. merge_many_custom(), which allows merging with custom n-ary Boolean functions.