用法:
skimage.filters.rank.pop(image, footprint, out=None, mask=None, shift_x=False, shift_y=False, shift_z=False)
返回像素的本地數量(人口)。
像素數定義為足跡和掩碼中包含的像素數。
- image:([P,] M, N) ndarray (uint8, uint16)
輸入圖像。
- footprint:ndarray
鄰域表示為 1 和 0 的 ndarray。
- out:([P,] M, N) 數組(與輸入的 dtype 相同)
如果沒有,則分配一個新數組。
- mask:ndarray(整數或浮點數),可選
定義包含在本地鄰域中的圖像的 (>0) 區域的掩碼數組。如果沒有,則使用完整的圖像(默認)。
- shift_x, shift_y, shift_z:int
添加到封裝中心點的偏移量。 Shift 受限於封裝尺寸(中心必須在給定封裝內)。
- out:([P,] M, N) ndarray (與輸入圖像相同的 dtype)
輸出圖像。
- selem:DEPRECATED
已棄用以支持足跡。
參數:
返回:
其他參數:
例子:
>>> from skimage.morphology import square, cube # Need to add 3D example >>> import skimage.filters.rank as rank >>> img = 255 * 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) >>> rank.pop(img, square(3)) array([[4, 6, 6, 6, 4], [6, 9, 9, 9, 6], [6, 9, 9, 9, 6], [6, 9, 9, 9, 6], [4, 6, 6, 6, 4]], dtype=uint8)
相關用法
- Python skimage.filters.rank.pop_bilateral用法及代碼示例
- Python skimage.filters.rank.noise_filter用法及代碼示例
- Python skimage.filters.rank.sum用法及代碼示例
- Python skimage.filters.rank.autolevel用法及代碼示例
- Python skimage.filters.rank.mean用法及代碼示例
- Python skimage.filters.rank.maximum用法及代碼示例
- Python skimage.filters.rank.equalize用法及代碼示例
- Python skimage.filters.rank.enhance_contrast用法及代碼示例
- Python skimage.filters.rank.gradient用法及代碼示例
- Python skimage.filters.rank.entropy用法及代碼示例
- Python skimage.filters.rank.otsu用法及代碼示例
- Python skimage.filters.rank.windowed_histogram用法及代碼示例
- Python skimage.filters.rank.sum_bilateral用法及代碼示例
- Python skimage.filters.rank.threshold用法及代碼示例
- Python skimage.filters.rank.majority用法及代碼示例
- Python skimage.filters.rank.geometric_mean用法及代碼示例
- Python skimage.filters.rank.subtract_mean用法及代碼示例
- Python skimage.filters.rank.minimum用法及代碼示例
- Python skimage.filters.rank.mean_bilateral用法及代碼示例
- Python skimage.filters.rank.modal用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.filters.rank.pop。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。