{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / morphology / isotropic / isotropic_dilation

function

skimage.morphology.isotropic:isotropic_dilation

source: /dev/scikit-image/src/skimage/morphology/isotropic.py :77

Signature

def   isotropic_dilation ( image radius out = None spacing = None )

Summary

Return binary morphological dilation of an image.

Extended Summary

Compared to the more general skimage.morphology.dilation, 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 inverted image [1], [2]. The implementation is based on: func:scipy.ndimage.distance_transform_edt.

Parameters

image : ndarray

Binary input image.

radius : float

The radius of the footprint used for the operation.

out : ndarray of bool, optional

The array to store the result of the morphology. If None is passed, a new array will be allocated.

spacing : float, or sequence of float, optional

Spacing 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

dilated : ndarray of bool

The result of the morphological dilation with values in [False, True].

Examples

Dilation enlarges bright regions
import numpy as np
import skimage as ski
image = np.array([[0, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0],
                  [0, 0, 1, 0, 0],
                  [0, 0, 1, 1, 0],
                  [0, 0, 0, 0, 0]], dtype=bool)
result = ski.morphology.isotropic_dilation(image, radius=1)
result.view(np.uint8)

Aliases

  • skimage.morphology.isotropic_dilation