Creates structure for depth-first graph traversal
Namespace: OpenCvSharp
Assembly: OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
Parameters
- graph
- Type: OpenCvSharpCvGraph
Graph. - vtx
- Type: OpenCvSharpCvGraphVtx
Initial vertex to start from. If NULL, the traversal starts from the first vertex (a vertex with the minimal index in the sequence of vertices). - mask
- Type: OpenCvSharpGraphScannerMask
Event mask indicating which events are interesting to the user (where cvNextGraphItem function returns control to the user) It can be CV_GRAPH_ALL_ITEMS (all events are interesting) or combination of the following flags:
* CV_GRAPH_VERTEX - stop at the graph vertices visited for the first time
* CV_GRAPH_TREE_EDGE - stop at tree edges (tree edge is the edge connecting the last visited vertex and the vertex to be visited next)
* CV_GRAPH_BACK_EDGE - stop at back edges (back edge is an edge connecting the last visited vertex with some of its ancestors in the search tree)
* CV_GRAPH_FORWARD_EDGE - stop at forward edges (forward edge is an edge conecting the last visited vertex with some of its descendants in the search tree). The forward edges are only possible during oriented graph traversal)
* CV_GRAPH_CROSS_EDGE - stop at cross edges (cross edge is an edge connecting different search trees or branches of the same tree. The cross edges are only possible during oriented graphs traversal)
* CV_GRAPH_ANY_EDGE - stop and any edge (tree, back, forward and cross edges)
* CV_GRAPH_NEW_TREE - stop in the beginning of every new search tree. When the traversal procedure visits all vertices and edges reachible from the initial vertex (the visited vertices together with tree edges make up a tree), it searches for some unvisited vertex in the graph and resumes the traversal process from that vertex. Before starting a new tree (including the very first tree when cvNextGraphItem is called for the first time) it generates CV_GRAPH_NEW_TREE event.
For unoriented graphs each search tree corresponds to a connected component of the graph.
* CV_GRAPH_BACKTRACKING - stop at every already visited vertex during backtracking - returning to already visited vertexes of the traversal tree.
See Also