remove_small_holes(ar, area_threshold=64, connectivity=1, in_place=False)
If the array type is int, it is assumed that it contains already-labeled objects. The labels are not kept in the output image (this function always outputs a bool image). It is suggested that labeling is completed after using this function.
The array containing the connected components of interest.
The maximum area, in pixels, of a contiguous hole that will be filled. Replaces :None:None:`min_size`
.
The connectivity defining the neighborhood of a pixel.
If :None:None:`True`
, remove the connected components in the input array itself. Otherwise, make a copy.
If the input array is of an invalid type, such as float or string.
If the input array contains negative values.
The input array with small holes within connected components removed.
Remove contiguous holes smaller than the specified size.
>>> from skimage import morphologyThis example is valid syntax, but we were not able to check execution
... a = np.array([[1, 1, 1, 1, 1, 0],
... [1, 1, 1, 0, 1, 0],
... [1, 0, 0, 1, 1, 0],
... [1, 1, 1, 1, 1, 0]], bool)
... b = morphology.remove_small_holes(a, 2)
... b array([[ True, True, True, True, True, False], [ True, True, True, True, True, False], [ True, False, False, True, True, False], [ True, True, True, True, True, False]])
>>> c = morphology.remove_small_holes(a, 2, connectivity=2)This example is valid syntax, but we were not able to check execution
... c array([[ True, True, True, True, True, False], [ True, True, True, False, True, False], [ True, False, False, True, True, False], [ True, True, True, True, True, False]])
>>> d = morphology.remove_small_holes(a, 2, in_place=True)See :
... d is a True
The following pages refer to to this document either explicitly or contain code examples using this.
skimage.morphology.misc.remove_small_holes
skimage.morphology.max_tree.area_opening
skimage.morphology.max_tree.area_closing
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them