用法:
skimage.future.graph.show_rag(labels, rag, image, border_color='black', edge_width=1.5, edge_cmap='magma', img_cmap='bone', in_place=True, ax=None)
在圖像上顯示區域鄰接圖。
給定一張帶標簽的圖像及其對應的 RAG,用指定的顏色在圖像上顯示 RAG 的節點和邊。邊顯示在圖像中兩個相鄰區域的質心之間。
- labels:ndarray,形狀(M,N)
標記的圖像。
- rag:RAG
區域鄰接圖。
- image:ndarray,形狀(M,N[,3])
輸入圖像。如果 colormap 為 None,則圖像應為 RGB 格式。
- border_color:顏色規格,可選
繪製區域之間邊界的顏色。
- edge_width:浮點數,可選
繪製 RAG 邊的厚度。
- edge_cmap:
matplotlib.colors.Colormap
繪製邊的任何 matplotlib 顏色圖。
- img_cmap:
matplotlib.colors.Colormap
用於繪製圖像的任何 matplotlib 顏色圖。如果設置為 None ,則按原樣繪製圖像。
- in_place:布爾型,可選
如果設置,RAG 將被修改到位。對於每個節點n該函數將設置一個新屬性
rag.nodes[n]['centroid']
.- ax:
matplotlib.axes.Axes
要繪製的軸。如果未指定,則創建並繪製新軸。
- lc:
matplotlib.collections.LineCollection
表示圖形邊的線的集合。它可以傳遞給
matplotlib.figure.Figure.colorbar()
- lc:
參數:
返回:
例子:
>>> from skimage import data, segmentation >>> from skimage.future import graph >>> import matplotlib.pyplot as plt >>> >>> img = data.coffee() >>> labels = segmentation.slic(img) >>> g = graph.rag_mean_color(img, labels) >>> lc = graph.show_rag(labels, g, img) >>> cbar = plt.colorbar(lc)
相關用法
- Python skimage.future.graph.RAG.__init__用法及代碼示例
- Python skimage.future.graph.cut_normalized用法及代碼示例
- Python skimage.future.graph.cut_threshold用法及代碼示例
- 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.show_rag。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。