當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。