merge_count#
- static rlemasklib.RLEMask.merge_count(masks, threshold)[source]#
Return a mask where each pixel is set if and only if at least threshold of the input masks have that pixel set.
For example, if
thresholdis set as half the number of masks, then the result will be the majority vote of the masks.- Parameters:
- Returns:
A new RLEMask object representing the merged mask.
- Return type:
Examples
Majority vote (at least 2 of 3 masks must agree):
merge_count([, , ], threshold=2) ==