用法:
skimage.morphology.dilation(image, footprint=None, out=None, shift_x=False, shift_y=False)
返回图像的灰度形态膨胀。
形态膨胀将像素的值设置为以它为中心的局部邻域内所有像素值的最大值。足迹为 1 的值定义了该邻域。膨胀扩大了明亮的区域并缩小了黑暗的区域。
- image:ndarray
图像阵列。
- footprint:ndarray,可选
邻域表示为 1 和 0 的数组。如果没有,请使用cross-shaped 占用空间(连接性=1)。
- out:ndarray,可选
存储形态学结果的数组。如果 None 被传递,将分配一个新数组。
- shift_x, shift_y:布尔型,可选
围绕中心点移动足迹。这仅影响 2D 偏心足迹(即,具有 even-numbered 边的足迹)。
- dilated:uint8 数组,形状和类型与图片
形态膨胀的结果。
- selem:DEPRECATED
已弃用以支持足迹。
参数:
返回:
其他参数:
注意:
为了uint8(和uint16达到一定的bit-depth) 数据,较低的算法复杂度使得skimage.filters.rank.maximum对更大的图像和足迹更有效。
例子:
>>> # Dilation enlarges bright regions >>> import numpy as np >>> from skimage.morphology import square >>> bright_pixel = np.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=np.uint8) >>> dilation(bright_pixel, square(3)) 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=uint8)
相关用法
- Python skimage.morphology.diameter_closing用法及代码示例
- Python skimage.morphology.diameter_opening用法及代码示例
- Python skimage.morphology.h_minima用法及代码示例
- 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.remove_small_objects用法及代码示例
- Python skimage.morphology.reconstruction用法及代码示例
- Python skimage.morphology.erosion用法及代码示例
- Python skimage.morphology.max_tree用法及代码示例
- Python skimage.morphology.local_minima用法及代码示例
- Python skimage.morphology.medial_axis用法及代码示例
- Python skimage.morphology.skeletonize用法及代码示例
注:本文由纯净天空筛选整理自scikit-image.org大神的英文原创作品 skimage.morphology.dilation。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。