用法:
skimage.morphology.remove_small_holes(ar, area_threshold=64, connectivity=1, in_place=False, *, out=None)
刪除小於指定尺寸的連續孔。
- ar:ndarray(任意形狀,int 或 bool 類型)
包含感興趣的連接組件的數組。
- area_threshold:int 可選(默認值:64)
將被填充的連續孔的最大麵積(以像素為單位)。替換min_size。
- connectivity:int {1, 2, ..., ar.ndim},可選(默認值:1)
定義像素鄰域的連通性。
- in_place:布爾值,可選(默認值:False)
如果為 True,則刪除輸入數組本身中的連接組件。否則,請製作副本。自 0.19 版起已棄用。請改用 out。
- out:ndarray
與 ar 和 bool dtype 形狀相同的數組,用於放置輸出。默認情況下,會創建一個新數組。
- out:ndarray,與輸入相同的形狀和類型阿爾
已移除連接組件內帶有小孔的輸入數組。
- TypeError
如果輸入數組的類型無效,例如浮點數或字符串。
- ValueError
如果輸入數組包含負值。
參數:
返回:
拋出:
注意:
如果數組類型是int,則假定它包含already-labeled 對象。標簽不保留在輸出圖像中(此函數始終輸出布爾圖像)。建議使用該函數後完成貼標。
例子:
>>> from skimage import morphology >>> a = np.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, out=a) >>> d is a True
相關用法
- Python skimage.morphology.remove_small_objects用法及代碼示例
- Python skimage.morphology.reconstruction用法及代碼示例
- Python skimage.morphology.h_minima用法及代碼示例
- Python skimage.morphology.dilation用法及代碼示例
- 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.diameter_closing用法及代碼示例
- Python skimage.morphology.erosion用法及代碼示例
- Python skimage.morphology.diameter_opening用法及代碼示例
- Python skimage.morphology.max_tree用法及代碼示例
- Python skimage.morphology.local_minima用法及代碼示例
- Python skimage.morphology.medial_axis用法及代碼示例
- Python skimage.morphology.skeletonize用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.morphology.remove_small_holes。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。