用法:
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。