Superpixel Benchmark
Superpixel benchmark, tools and algorithms.
|
Represents an image graph, consisting of one node per pixel which are 4-connected. More...
#include <image_graph.h>
Public Member Functions | |
ImageGraph () | |
Default constructor. More... | |
ImageGraph (int N) | |
Constructs an image graph with the given exact number of nodes. More... | |
void | operator= (const ImageGraph &graph) |
Assignment operator. More... | |
void | setNode (int n, ImageNode &node) |
Set the node of the given index. More... | |
void | addNode (ImageNode &node) |
Add a new node. More... | |
void | addEdge (ImageEdge &edge) |
Add a new edge. More... | |
ImageNode & | getNode (int n) |
ImageEdge & | getEdge (int e) |
Get the e-th edge in the current sorting. More... | |
int | getNumNodes () |
Get the number of nodes. More... | |
int | getNumEdges () |
Get the number of edges. More... | |
int | getNumComponents () |
Get number of connected components. More... | |
void | sortEdges () |
Sort the edges by weight. More... | |
ImageNode & | findNodeComponent (ImageNode &n) |
When two nodes get merged, the first node is assigned the id of the second node as label. By traversing this labeling, the current component of each node (that is, pixel) can easily be identified and the label can be updated for efficiency. More... | |
void | merge (ImageNode &S_n, ImageNode &S_m, ImageEdge &e) |
Merge two pixels (that is merge two nodes). More... | |
Represents an image graph, consisting of one node per pixel which are 4-connected.
|
inline |
Default constructor.
|
inline |
Constructs an image graph with the given exact number of nodes.
[in] | N | number of nodes to allocate |
|
inline |
Add a new edge.
[in] | edge |
|
inline |
Add a new node.
[in] | node |
When two nodes get merged, the first node is assigned the id of the second node as label. By traversing this labeling, the current component of each node (that is, pixel) can easily be identified and the label can be updated for efficiency.
[in] | node | node to find component for |
|
inline |
Get the e-th edge in the current sorting.
[in] | e | edge index |
|
inline |
[in] | Get | the n-th node. |
[in] | n | node index |
|
inline |
Get number of connected components.
|
inline |
Get the number of edges.
|
inline |
Get the number of nodes.
Merge two pixels (that is merge two nodes).
Depending on the used "Distance", some lines may be commented out to speed up the algorithm.
[in] | S_n | first node |
[in] | S_m | second node |
[in] | e | corresponding edge |
|
inline |
Assignment operator.
[in] | graph | graph to copy |
|
inline |
Set the node of the given index.
[in] | n | index of node |
[in] | node |
|
inline |
Sort the edges by weight.