![]() |
Direct Graphical Models
v.1.7.0
|
Fully-connected (dense) graph class. More...
#include <GraphDense.h>
Public Member Functions | |
CGraphDense (byte nStates) | |
Constructor. More... | |
virtual | ~CGraphDense (void)=default |
void | reset (void) override |
Resets the graph. More... | |
size_t | addNode (const Mat &pot=EmptyMat) override |
Adds an additional node (with specified potentional) More... | |
void | addNodes (const Mat &pots) override |
Adds the graph nodes with potentials. More... | |
void | setNode (size_t node, const Mat &pot) override |
Sets or changes the potential of node. More... | |
void | setNodes (size_t start_node, const Mat &pots) override |
Fills the graph nodes with new potentials. More... | |
void | getNode (size_t node, Mat &pot) const override |
Returns the node potential. More... | |
void | getNodes (size_t start_node, size_t num_nodes, Mat &pots) const override |
Returns the node potentials. More... | |
void | getChildNodes (size_t node, vec_size_t &vNodes) const override |
Returns the set of IDs of the child nodes of the argument node. More... | |
void | getParentNodes (size_t node, vec_size_t &vNodes) const override |
Returns the set of IDs of the parent nodes of the argument node. More... | |
size_t | getNumNodes (void) const override |
Returns the number of nodes in the graph. More... | |
size_t | getNumEdges (void) const override |
Returns the number of edges in the graph. More... | |
void | addEdgeModel (const ptr_edgeModel_t &pEdgeModel) |
Adds an edge model. More... | |
Mat | getNodePotentials (void) const |
Returns the container with node potentials. More... | |
std::vector< ptr_edgeModel_t > & | getEdgeModels (void) const |
Returns the contener with edge models. More... | |
![]() | |
CGraph (byte nStates) | |
Constructor. More... | |
CGraph (const CGraph &)=delete | |
virtual | ~CGraph (void)=default |
const CGraph & | operator= (const CGraph &)=delete |
byte | getNumStates (void) const |
Returns number of states (classes) More... | |
Private Attributes | |
Mat | m_nodePotentials |
The container for the node potentials: Mat(nNodes, nStates, CV_32FC1), i.e. every row is a node potential vector. More... | |
std::vector< ptr_edgeModel_t > | m_vpEdgeModels |
The set of edge models. More... | |
Fully-connected (dense) graph class.
Definition at line 15 of file GraphDense.h.
|
inline |
Constructor.
nStates | the number of States (classes) |
Definition at line 22 of file GraphDense.h.
|
virtualdefault |
|
inline |
Adds an edge model.
Dense CRF may have multiple edge models. All edge models will be subsequently applied during the iterations of the inference process.
pEdgeModel | Poiter to an dense edge model (ref. IEdgeModel) |
Definition at line 49 of file GraphDense.h.
|
overridevirtual |
Adds an additional node (with specified potentional)
pot | node potential vector: Mat(size: nStates x 1; type: CV_32FC1) |
Implements DirectGraphicalModels::CGraph.
Definition at line 7 of file GraphDense.cpp.
|
inlineoverridevirtual |
Adds the graph nodes with potentials.
pots | A block of potentials: Mat(size: nNodes x nStates; type: CV_32FC1) |
Reimplemented from DirectGraphicalModels::CGraph.
Definition at line 29 of file GraphDense.h.
|
overridevirtual |
Returns the set of IDs of the child nodes of the argument node.
[in] | node | node index |
[out] | vNodes | vector with the child node's ID |
Implements DirectGraphicalModels::CGraph.
Definition at line 56 of file GraphDense.cpp.
|
inline |
Returns the contener with edge models.
One edge model applies itself to all the edges in the graph
Definition at line 60 of file GraphDense.h.
|
overridevirtual |
Returns the node potential.
[in] | node | node index |
[out] | pot | node potential vector: Mat(size: nStates x 1; type: CV_32FC1) |
Implements DirectGraphicalModels::CGraph.
Definition at line 36 of file GraphDense.cpp.
|
inline |
Returns the container with node potentials.
Definition at line 54 of file GraphDense.h.
|
overridevirtual |
Returns the node potentials.
This function supports PPL
[in] | start_node | The index of the node, starting from which the potentials should be got |
[in] | num_nodes | The number of nodes potentials to acquire. 0 means - read nodes from start_node till the last one. |
[out] | pots | A block of potentials: Mat(size: num_nodes x nStates; type: CV_32FC1) |
Reimplemented from DirectGraphicalModels::CGraph.
Definition at line 47 of file GraphDense.cpp.
|
inlineoverridevirtual |
Returns the number of edges in the graph.
Implements DirectGraphicalModels::CGraph.
Definition at line 41 of file GraphDense.h.
|
inlineoverridevirtual |
Returns the number of nodes in the graph.
Implements DirectGraphicalModels::CGraph.
Definition at line 40 of file GraphDense.h.
|
inlineoverridevirtual |
Returns the set of IDs of the parent nodes of the argument node.
[in] | node | node index |
[out] | vNodes | vector with the parent node's ID |
Implements DirectGraphicalModels::CGraph.
Definition at line 38 of file GraphDense.h.
|
inlineoverridevirtual |
Resets the graph.
This function allows to re-use the graph or update node potential, while preserving the graph structure. It deletes all the nodes and edges and sets node index to zero.
Implements DirectGraphicalModels::CGraph.
Definition at line 26 of file GraphDense.h.
|
overridevirtual |
Sets or changes the potential of node.
node | node index |
pot | node potential vector: Mat(size: nStates x 1; type: CV_32FC1) |
Implements DirectGraphicalModels::CGraph.
Definition at line 15 of file GraphDense.cpp.
|
overridevirtual |
Fills the graph nodes with new potentials.
This function supports PPL
start_node | The index of the node, starting from which the potentials should be set |
pots | A block of potentials: Mat(size: nNodes x nStates; type: CV_32FC1) |
Reimplemented from DirectGraphicalModels::CGraph.
Definition at line 25 of file GraphDense.cpp.
|
private |
The container for the node potentials: Mat(nNodes, nStates, CV_32FC1), i.e. every row is a node potential vector.
Definition at line 64 of file GraphDense.h.
|
mutableprivate |
The set of edge models.
Definition at line 65 of file GraphDense.h.