用法:
skimage.future.graph.rag_boundary(labels, edge_map, connectivity=2)
基於區域邊界的計算機 RAG
給定圖像的初始分割及其邊圖,此方法構造相應的區域鄰接圖 (RAG)。 RAG 中的每個節點代表圖像中具有相同標簽的一組像素。兩個相鄰區域之間的權重是沿其邊界的edge_map 中的平均值。
- 標簽ndarray
標記的圖像。
- edge_mapndarray
這應該與標簽的形狀相同。對於沿2個相鄰區域邊界的所有像素,edge_map中對應像素的平均值就是它們之間的邊權重。
- 連通性int 可選
平方距離小於的像素連通性彼此被認為是相鄰的。它的範圍可以從 1 到labels.ndim.它的行為與連通性參數輸入
scipy.ndimage.generate_binary_structure
.
例子:
>>> from skimage import data, segmentation, filters, color >>> from skimage.future import graph >>> img = data.chelsea() >>> labels = segmentation.slic(img) >>> edge_map = filters.sobel(color.rgb2gray(img)) >>> rag = graph.rag_boundary(labels, edge_map)
相關用法
- Python skimage.future.graph.rag_mean_color用法及代碼示例
- Python skimage.future.graph.RAG.__init__用法及代碼示例
- Python skimage.future.graph.show_rag用法及代碼示例
- Python skimage.future.graph.cut_normalized用法及代碼示例
- Python skimage.future.graph.cut_threshold用法及代碼示例
- Python skimage.future.graph.ncut用法及代碼示例
- 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.rag_boundary。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。