cupyx.scipy.ndimage.binary_fill_holes(input, structure=None, output=None, origin=0)[source]

Fill the holes in binary objects.

  • input (cupy.ndarray) – N-D binary array with holes to be filled.

  • structure (cupy.ndarray, optional) – Structuring element used in the computation; large-size elements make 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.


Transformation of the initial image input where holes

have been filled.

Return type



This function may synchronize the device.