用法:
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。