diff --git a/skimage/graph/graph_cut.py b/skimage/graph/graph_cut.py index 40adcdf8..2e72ac2b 100644 --- a/skimage/graph/graph_cut.py +++ b/skimage/graph/graph_cut.py @@ -31,6 +31,13 @@ def threshold_cut(label, rag, thresh): >>> labels = segmentation.slic(img) >>> rag = graph.rag_meancolor(img, labels) >>> new_labels = graph.threshold_cut(labels, rag, 10) + + References + ---------- + .. [1] Alain Tremeau and Philippe Colantoni + "Regions Adjacency Graph Applied To Color Image Segmentation" + http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.11.5274 + """ to_remove = [(x, y) for x, y, d in rag.edges_iter(data=True) if d['weight'] >= thresh] diff --git a/skimage/graph/rag.py b/skimage/graph/rag.py index e788455d..0b01880d 100644 --- a/skimage/graph/rag.py +++ b/skimage/graph/rag.py @@ -66,7 +66,7 @@ def rag_meancolor(img, arr): Given an image and its segmentation, this method constructs the corresponsing Region Adjacency Graph (RAG).Each node in the RAG represents a contiguous pixels with in `img` the same label in - `arr` + `arr`. Parameters ---------- @@ -87,6 +87,12 @@ def rag_meancolor(img, arr): >>> labels = segmentation.slic(img) >>> rag = graph.rag_meancolor(img, labels) + References + ---------- + .. [1] Alain Tremeau and Philippe Colantoni + "Regions Adjacency Graph Applied To Color Image Segmentation" + http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.11.5274 + """ g = RAG()