用法:
cucim.skimage.morphology.remove_small_holes(ar, area_threshold=64, connectivity=1, in_place=False)
刪除小於指定尺寸的連續孔。
- ar:ndarray(任意形狀,int 或 bool 類型)
包含感興趣的連接組件的數組。
- area_threshold:int,可選(默認值:64)
將被填充的連續孔的最大麵積(以像素為單位)。替換
min_size
。- connectivity:int, {1, 2, ..., ar.ndim},可選(默認值:1)
定義像素鄰域的連通性。
- in_place:布爾值,可選(默認值:False)
如果
True
,刪除輸入數組本身中的連接組件。否則,請製作副本。
- out:ndarray,與輸入相同的形狀和類型
ar
已移除連接組件內帶有小孔的輸入數組。
- out:ndarray,與輸入相同的形狀和類型
- TypeError
如果輸入數組的類型無效,例如浮點數或字符串。
- ValueError
如果輸入數組包含負值。
參數:
返回:
拋出:
注意:
如果數組類型是 int,則假定它包含 already-labeled 個對象。標簽不保留在輸出圖像中(此函數始終輸出布爾圖像)。建議使用該函數後完成貼標。
例子:
>>> import cupy as cp >>> from cucim.skimage import morphology >>> a = cp.array([[1, 1, 1, 1, 1, 0], ... [1, 1, 1, 0, 1, 0], ... [1, 0, 0, 1, 1, 0], ... [1, 1, 1, 1, 1, 0]], bool) >>> b = morphology.remove_small_holes(a, 2) >>> b array([[ True, True, True, True, True, False], [ True, True, True, True, True, False], [ True, False, False, True, True, False], [ True, True, True, True, True, False]]) >>> c = morphology.remove_small_holes(a, 2, connectivity=2) >>> c array([[ True, True, True, True, True, False], [ True, True, True, False, True, False], [ True, False, False, True, True, False], [ True, True, True, True, True, False]]) >>> d = morphology.remove_small_holes(a, 2, in_place=True) >>> d is a True
相關用法
- Python cucim.skimage.morphology.remove_small_objects用法及代碼示例
- Python cucim.skimage.morphology.reconstruction用法及代碼示例
- Python cucim.skimage.morphology.dilation用法及代碼示例
- Python cucim.skimage.morphology.closing用法及代碼示例
- Python cucim.skimage.morphology.erosion用法及代碼示例
- Python cucim.skimage.morphology.white_tophat用法及代碼示例
- Python cucim.skimage.morphology.black_tophat用法及代碼示例
- 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.remove_small_holes。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。