scipy.ndimage.morphology.binary_fill_holes

scipy.ndimage.morphology.binary_fill_holes(input, structure=None, output=None, origin=0)

Fill the holes in binary objects.

An output array can optionally be provided. The origin parameter controls the placement of the filter. If no structuring element is provided an element is generated with a squared connectivity equal to one.