cupyx.scipy.ndimage.binary_fill_holes#
- cupyx.scipy.ndimage.binary_fill_holes(input, structure=None, output=None, origin=0, *, axes=None)[source]#
Fill the holes in binary objects.
- Parameters:
input (cupy.ndarray) – N-D binary array with holes to be filled.
structure (cupy.ndarray, optional) – For CuPy, it is recommended to leave this None so that a faster non-iterative algorithm will be used. This default is equivalent in behavior to the default structure use by SciPy. If structure array is provided, the relatively slow iterative algorithm from SciPy will be used. In that case, a larger-size structure can make the iterative computations faster, but may miss holes separated from the background by thin regions. The default element (with a square connectivity equal to one) yields the intuitive result where all holes in the input have been filled.
output (cupy.ndarray, dtype or None, optional) – Array of the same shape as input, into which the output is placed. By default, a new array is created.
origin (int, tuple of ints, optional) – Position of the structuring element. Note that if this is changed from its default value of 0, it will force a slower iterative algorithm to be used.
axes (tuple of int or None) – The axes over which to apply the filter. If None, input is filtered along all axes. If an origin tuple is provided, its length must match the number of axes.
- Returns:
Transformation of the initial image
inputwhere holes have been filled.- Return type:
Warning
This function may synchronize the device.
Warning
It is recommended to keep the default setting of output=None and origin==0 so that a faster, non-iterative algorithm can be used.
See also