用法:
skimage.future.graph.cut_normalized(labels, rag, thresh=0.001, num_cuts=10, in_place=True, max_edge=1.0, *, random_state=None)
對 Region Adjacency Graph 執行 Normalized Graph cut。
給定圖像的標簽及其相似性 RAG,遞歸地對其執行 2-way normalized cut。屬於不能被進一步切割的子圖的所有節點在輸出中被分配一個唯一的標簽。
- labels:ndarray
標簽數組。
- rag:RAG
區域鄰接圖。
- thresh:浮點數
門檻。如果N-cut的值超過閾值,則不會進一步細分子圖。
- num_cuts:int
在確定最佳值之前要執行的編號或N-cuts。
- in_place:bool
如果設置,修改
rag
到位。對於每個節點n該函數將設置一個新屬性rag.nodes[n]['ncut label']
.- max_edge:浮點數,可選
RAG 中邊的最大可能值。這對應於相同區域之間的邊。這用於將自身邊放入 RAG。
- random_state:{無,int
numpy.random.Generator
如果random_state是沒有的
numpy.random.Generator
使用單例。如果random_state是一個int 一個新的Generator
使用實例,播種random_state.如果random_state已經是一個Generator
實例然後使用該實例。random_state用於起點
scipy.sparse.linalg.eigsh
.
- out:ndarray
新標記的數組。
參數:
返回:
參考:
- 1
Shi, J.; Malik, J., “Normalized cuts and image segmentation”, Pattern Analysis and Machine Intelligence, IEEE Transactions on, vol. 22, no. 8, pp. 888-905, August 2000.
例子:
>>> from skimage import data, segmentation >>> from skimage.future import graph >>> img = data.astronaut() >>> labels = segmentation.slic(img) >>> rag = graph.rag_mean_color(img, labels, mode='similarity') >>> new_labels = graph.cut_normalized(labels, rag)
相關用法
- Python skimage.future.graph.cut_threshold用法及代碼示例
- Python skimage.future.graph.RAG.__init__用法及代碼示例
- Python skimage.future.graph.show_rag用法及代碼示例
- Python skimage.future.graph.ncut用法及代碼示例
- Python skimage.future.graph.rag_boundary用法及代碼示例
- Python skimage.future.graph.rag_mean_color用法及代碼示例
- Python skimage.future.manual_polygon_segmentation用法及代碼示例
- Python skimage.future.manual_lasso_segmentation用法及代碼示例
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
- Python skimage.feature.blob_dog用法及代碼示例
- Python skimage.filters.unsharp_mask用法及代碼示例
- Python skimage.filters.rank.noise_filter用法及代碼示例
- Python skimage.filters.gaussian用法及代碼示例
- Python skimage.feature.graycoprops用法及代碼示例
- Python skimage.feature.corner_orientations用法及代碼示例
- Python skimage.filters.threshold_otsu用法及代碼示例
- Python skimage.feature.structure_tensor用法及代碼示例
- Python skimage.filters.rank.sum用法及代碼示例
- Python skimage.filters.window用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.future.graph.cut_normalized。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。