当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


Python skimage.future.graph.cut_threshold用法及代码示例

用法:

skimage.future.graph.cut_threshold(labels, rag, thresh, in_place=True)

合并按权重小于阈值的区域。

给定图像的标签及其 RAG,通过组合节点之间的权重小于给定阈值的区域来输出新标签。

参数

labelsndarray

标签数组。

ragRAG

区域邻接图。

thresh浮点数

门槛。由具有较小权重的边连接的区域被组合起来。

in_placebool

如果设置,修改rag到位。该函数将删除权重小于脱粒.如果设置为False该函数复制rag在继续之前。

返回

outndarray

新标记的数组。

参考

1

Alain Tremeau and Philippe Colantoni “Regions Adjacency Graph Applied To Color Image Segmentation” DOI:10.1109/83.841950

例子

>>> from skimage import data, segmentation
>>> from skimage.future import graph
>>> img = data.astronaut()
>>> labels = segmentation.slic(img)
>>> rag = graph.rag_mean_color(img, labels)
>>> new_labels = graph.cut_threshold(labels, rag, 10)

相关用法


注:本文由纯净天空筛选整理自scikit-image.org大神的英文原创作品 skimage.future.graph.cut_threshold。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。