beatmup.FloodFill

class beatmup.FloodFill

Discovers areas of similar colors up to a tolerance threshold around given positions (seeds) in the input image. These areas are filled with white color in another image (output). If the output bitmap is a binary mask, corresponding pixels are set to 1. The rest of the output image remains unchanged. Optionally, computes contours around the discovered areas and stores the contour positions. Also optionally, applies post-processing by dilating or eroding the discovered regions in the output image.

__init__(self: beatmup.FloodFill) None

Methods

__init__(self)

get_bounds(self, arg0)

Returns bounding box of the computed mask

get_contour(self, index)

Returns a contour by index if compute_contours was set to True, throws an exception otherwise

get_contour_count(self)

Returns number of discovered contours

set_border_postprocessing(self, operation, ...)

Specifies a morphological operation to apply to the mask border.

set_compute_contours(self, compute)

Enables or disables contours computation

set_mask_pos(self, pos)

Specifies left-top corner position of the mask inside the input bitmap

set_seeds(self, seeds)

Specifies a set of seeds (starting points)

Attributes

DILATE

ERODE

NONE

input

Input bitmap

output

Output bitmap

tolerance

Intensity tolerance