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