用法:
skimage.morphology.erosion(image, footprint=None, out=None, shift_x=False, shift_y=False)
返回图像的灰度形态侵蚀。
形态侵蚀将 (i,j) 处的像素设置为以 (i,j) 为中心的邻域中所有像素的最小值。侵蚀缩小了明亮区域并扩大了黑暗区域。
- image:ndarray
图像阵列。
- footprint:ndarray,可选
邻域表示为 1 和 0 的数组。如果没有,请使用cross-shaped 占用空间(连接性=1)。
- out:ndarrays,可选
存储形态学结果的数组。如果 None 被传递,将分配一个新数组。
- shift_x, shift_y:布尔型,可选
围绕中心点移动足迹。这只影响偏心足迹(即偶数边的足迹)。
- eroded:数组,形状相同图片
形态侵蚀的结果。
- selem:DEPRECATED
已弃用以支持足迹。
参数:
返回:
其他参数:
注意:
对于
uint8
(和uint16
到某个bit-depth)数据,较低的算法复杂度使得skimage.filters.rank.minimum
例子:
>>> # Erosion shrinks bright regions >>> import numpy as np >>> from skimage.morphology import square >>> bright_square = np.array([[0, 0, 0, 0, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], ... [0, 1, 1, 1, 0], ... [0, 0, 0, 0, 0]], dtype=np.uint8) >>> erosion(bright_square, square(3)) array([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], dtype=uint8)
相关用法
- Python skimage.morphology.h_minima用法及代码示例
- Python skimage.morphology.dilation用法及代码示例
- Python skimage.morphology.remove_small_holes用法及代码示例
- Python skimage.morphology.flood_fill用法及代码示例
- Python skimage.morphology.black_tophat用法及代码示例
- Python skimage.morphology.h_maxima用法及代码示例
- Python skimage.morphology.local_maxima用法及代码示例
- Python skimage.morphology.area_closing用法及代码示例
- Python skimage.morphology.label用法及代码示例
- Python skimage.morphology.max_tree_local_maxima用法及代码示例
- Python skimage.morphology.thin用法及代码示例
- Python skimage.morphology.flood用法及代码示例
- Python skimage.morphology.diameter_closing用法及代码示例
- Python skimage.morphology.remove_small_objects用法及代码示例
- Python skimage.morphology.reconstruction用法及代码示例
- Python skimage.morphology.diameter_opening用法及代码示例
- Python skimage.morphology.max_tree用法及代码示例
- Python skimage.morphology.local_minima用法及代码示例
- Python skimage.morphology.medial_axis用法及代码示例
- Python skimage.morphology.skeletonize用法及代码示例
注:本文由纯净天空筛选整理自scikit-image.org大神的英文原创作品 skimage.morphology.erosion。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。