用法:
cucim.skimage.morphology.dilation(image, selem=None, out=None, shift_x=False, shift_y=False)
返回圖像的灰度形態膨脹。
形態膨脹將 (i,j) 處的像素設置為以 (i,j) 為中心的鄰域中所有像素的最大值。膨脹擴大了明亮的區域並縮小了黑暗的區域。
- image:ndarray
圖像陣列。
- selem:ndarray,可選
鄰域表示為 1 和 0 的二維數組。如果沒有,使用cross-shaped 結構元素(連接性=1)。
- out:ndarray,可選
存儲形態學結果的數組。如果 None, 被傳遞,將分配一個新數組。
- shift_x, shift_y:布爾型,可選
圍繞中心點移動結構元素。這隻會影響偏心的結構元素(即帶有偶數邊的 selem)。
- dilated:uint8 數組,與
image
相同的形狀和類型 形態膨脹的結果。
- dilated:uint8 數組,與
參數:
返回:
注意:
對於
uint8
(和uint16
到某個bit-depth)數據,較低的算法複雜度使得skimage.filters.rank.maximum
函數對於較大的圖像和結構元素更有效。例子:
>>> # Dilation enlarges bright regions >>> import cupy as cp >>> from cucim.skimage.morphology import square >>> bright_pixel = cp.asarray([[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=cp.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 cucim.skimage.morphology.closing用法及代碼示例
- Python cucim.skimage.morphology.erosion用法及代碼示例
- Python cucim.skimage.morphology.white_tophat用法及代碼示例
- Python cucim.skimage.morphology.remove_small_holes用法及代碼示例
- Python cucim.skimage.morphology.black_tophat用法及代碼示例
- Python cucim.skimage.morphology.reconstruction用法及代碼示例
- Python cucim.skimage.morphology.remove_small_objects用法及代碼示例
- Python cucim.skimage.morphology.opening用法及代碼示例
- Python cucim.skimage.morphology.thin用法及代碼示例
- Python cucim.skimage.measure.label用法及代碼示例
- Python cucim.skimage.measure.moments_coords用法及代碼示例
- Python cucim.skimage.measure.moments_normalized用法及代碼示例
- Python cucim.skimage.measure.moments_central用法及代碼示例
- Python cucim.skimage.measure.moments_coords_central用法及代碼示例
- Python cucim.skimage.measure.perimeter用法及代碼示例
- Python cucim.skimage.measure.regionprops用法及代碼示例
- Python cucim.skimage.measure.moments用法及代碼示例
- Python cucim.skimage.measure.centroid用法及代碼示例
- Python cucim.skimage.measure.moments_hu用法及代碼示例
- Python cucim.skimage.measure.profile_line用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cucim.skimage.morphology.dilation。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。