merge_hierarchical
-
skimage.future.graph.merge_hierarchical(labels, rag, thresh, rag_copy, in_place_merge, merge_func, weight_func)
[source] -
Perform hierarchical merging of a RAG.
Greedily merges the most similar pair of nodes until no edges lower than
thresh
remain.Parameters: labels : ndarray
The array of labels.
rag : RAG
The Region Adjacency Graph.
thresh : float
Regions connected by an edge with weight smaller than
thresh
are merged.rag_copy : bool
If set, the RAG copied before modifying.
in_place_merge : bool
If set, the nodes are merged in place. Otherwise, a new node is created for each merge..
merge_func : callable
This function is called before merging two nodes. For the RAG
graph
while mergingsrc
anddst
, it is called as followsmerge_func(graph, src, dst)
.weight_func : callable
The function to compute the new weights of the nodes adjacent to the merged node. This is directly supplied as the argument
weight_func
tomerge_nodes
.Returns: out : ndarray
The new labeled array.
Please login to continue.