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