bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / morphology / isotropic / isotropic_erosion
function
skimage.morphology.isotropic:isotropic_erosion
source: /dev/scikit-image/src/skimage/morphology/isotropic.py :9
Signature
def isotropic_erosion ( image , radius , out = None , spacing = None ) Summary
Return binary morphological erosion of an image.
Extended Summary
Compared to the more general skimage.morphology.erosion, this function only supports binary inputs and circular footprints. However, it performs typically faster for large (circular) footprints. This works by applying a threshold to the exact Euclidean distance map of the image [1], [2]. The implementation is based on: func:scipy.ndimage.distance_transform_edt.
Parameters
image: ndarrayBinary input image.
radius: floatThe radius of the footprint used for the operation.
out: ndarray of bool, optionalThe array to store the result of the morphology. If None, a new array will be allocated.
spacing: float, or sequence of float, optionalSpacing of elements along each dimension. If a sequence, must be of length equal to the input's dimension (number of axes). If a single number, this value is used for all axes. If not specified, a grid spacing of unity is implied.
Returns
eroded: ndarray of boolThe result of the morphological erosion taking values in
[False, True].
Examples
Erosion shrinks bright regionsimport numpy as np import skimage as ski image = np.array([[0, 0, 1, 0, 0], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0], [0, 1, 1, 1, 0], [0, 0, 0, 0, 0]], dtype=bool) result = ski.morphology.isotropic_erosion(image, radius=1) result.view(np.uint8)✓
Aliases
-
skimage.morphology.isotropic_erosion