cupyx.scipy.ndimage.generate_binary_structure#
- cupyx.scipy.ndimage.generate_binary_structure(rank, connectivity)[source]#
Generate a binary structure for binary morphological operations.
- Parameters:
rank (int) – Number of dimensions of the array to which the structuring element will be applied, as returned by
np.ndim.connectivity (int) –
connectivitydetermines which elements of the output array belong to the structure, i.e., are considered as neighbors of the central element. Elements up to a squared distance ofconnectivityfrom the center are considered neighbors.connectivitymay range from 1 (no diagonal elements are neighbors) torank(all elements are neighbors).
- Returns:
Structuring element which may be used for binary morphological operations, with
rankdimensions and all dimensions equal to 3.- Return type: