cupyx.scipy.ndimage.label#

cupyx.scipy.ndimage.label(input, structure=None, output=None)[source]#

Labels features in an array.

Parameters
  • input (cupy.ndarray) – The input array.

  • structure (array_like or None) – A structuring element that defines feature connections. `structure` must be centersymmetric. If None, structure is automatically generated with a squared connectivity equal to one.

  • output (cupy.ndarray, dtype or None) – The array in which to place the output.

Returns

An integer array where each unique feature in `input` has a unique label in the array.

num_features (int): Number of features found.

Return type

label (cupy.ndarray)

Warning

This function may synchronize the device.