porespy.filters.erode#
- porespy.filters.erode(im: numpy.typing.NDArray, r: int, dt: numpy.typing.NDArray = None, method: str = 'dt', smooth: bool = True)#
Perform erosion with a round structuring element
- Parameters:
im (ndarray) – A boolean image with the foreground (to be eroded) indicated by True
r (int) – The radius of the round structuring element to use
dt (ndarray) – The distance transform of the foreground. If not provided it will be computed. This argument is only relevant if method=’dt’.
smooth (boolean) – If True (default) the single voxel protrusion on the face of the structuring element are removed.
method (str) –
Controls which method is used. Options are:
method
Description
’dt’
Uses a distance transform to find all voxels within r of the background, then removes them to affect an erosion
’conv’
Uses a FFT based convolution to find all voxels within r of the background (voxels with a value smaller than the sum of the structuring element), then removes them to affect an erosion.
- Returns:
erosion – An image the same size as im with the foreground eroded by the specified amount.
- Return type:
ndarray