bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / graph / _graph_cut / cut_threshold
function
skimage.graph._graph_cut:cut_threshold
source: /dev/scikit-image/src/skimage/graph/_graph_cut.py :9
Signature
def cut_threshold ( labels , rag , thresh , in_place = True ) Summary
Combine regions separated by weight less than threshold.
Extended Summary
Given an image's labels and its RAG, output new labels by combining regions whose nodes are separated by a weight less than the given threshold.
Parameters
labels: ndarrayThe array of labels.
rag: RAGThe region adjacency graph.
thresh: floatThe threshold. Regions connected by edges with smaller weights are combined.
in_place: boolIf set, modifies
ragin place. The function will remove the edges with weights less thatthresh. If set toFalsethe function makes a copy ofragbefore proceeding.
Returns
out: ndarrayThe new labelled array.
Examples
from skimage import data, segmentation, graph img = data.astronaut() labels = segmentation.slic(img) rag = graph.rag_mean_color(img, labels) new_labels = graph.cut_threshold(labels, rag, 10)✓
Aliases
-
skimage.graph.cut_threshold