用法:
skimage.segmentation.felzenszwalb(image, scale=1, sigma=0.8, min_size=20, multichannel=True, *, channel_axis=- 1)
計算 Felsenszwalb 的基於圖形的高效圖像分割。
在圖像網格上使用基於最小生成樹的快速聚類生成多通道(即 RGB)圖像的過分割。參數
scale
設置觀察級別。更高的規模意味著更少和更大的細分市場。sigma
是高斯核的直徑,用於在分割之前對圖像進行平滑處理。生成的段數及其大小隻能通過
scale
間接控製。圖像中的段大小可能會因局部對比度而有很大差異。對於 RGB 圖像,該算法使用顏色空間中像素之間的歐式距離。
- image:(寬度,高度,3)或(寬度,高度)ndarray
輸入圖像。
- scale:浮點數
自由參數。更高意味著更大的集群。
- sigma:浮點數
預處理中使用的高斯核的寬度(標準偏差)。
- min_size:int
最小組件尺寸。使用後處理強製執行。
- multichannel:布爾值,可選(默認值:True)
圖像的最後一個軸是否被解釋為多個通道。當前不支持 3D 圖像的 False 值。不推薦使用此參數:改為指定 channel_axis。
- channel_axis:int 或無,可選
如果為 None,則假定圖像是灰度(單通道)圖像。否則,此參數指示數組的哪個軸對應於通道。
- segment_mask:(寬度,高度)ndarray
指示段標簽的整數掩碼。
- multichannel:DEPRECATED
已棄用以支持channel_axis。
參數:
返回:
其他參數:
注意:
原論文中使用的 k 參數在此處重命名為 scale。
參考:
- 1
Efficient graph-based image segmentation, Felzenszwalb, P.F. and Huttenlocher, D.P. International Journal of Computer Vision, 2004
例子:
>>> from skimage.segmentation import felzenszwalb >>> from skimage.data import coffee >>> img = coffee() >>> segments = felzenszwalb(img, scale=3.0, sigma=0.95, min_size=5)
相關用法
- Python skimage.segmentation.flood_fill用法及代碼示例
- Python skimage.segmentation.find_boundaries用法及代碼示例
- Python skimage.segmentation.flood用法及代碼示例
- Python skimage.segmentation.active_contour用法及代碼示例
- Python skimage.segmentation.relabel_sequential用法及代碼示例
- Python skimage.segmentation.clear_border用法及代碼示例
- Python skimage.segmentation.watershed用法及代碼示例
- Python skimage.segmentation.expand_labels用法及代碼示例
- Python skimage.segmentation.random_walker用法及代碼示例
- Python skimage.segmentation.slic用法及代碼示例
- Python skimage.segmentation.join_segmentations用法及代碼示例
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.color.lab2lch用法及代碼示例
- Python skimage.draw.random_shapes用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
- Python skimage.feature.blob_dog用法及代碼示例
- Python skimage.filters.unsharp_mask用法及代碼示例
- Python skimage.registration.optical_flow_tvl1用法及代碼示例
- Python skimage.filters.rank.noise_filter用法及代碼示例
- Python skimage.exposure.histogram用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.segmentation.felzenszwalb。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。