merge-hierarchical

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 merging src and dst, it is called as follows merge_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 to merge_nodes.

Returns:

out : ndarray

The new labeled array.

doc_scikit_image
2017-01-12 17:22:04
Comments
Leave a Comment

Please login to continue.