Base abstract class for random model decoding.
More...
#include <Decode.h>
|
virtual | ~CDecode (void) |
|
virtual vec_byte_t | decode (Mat &lossMatrix=EmptyMat) const |
| Approximate decoding. More...
|
|
Base abstract class for random model decoding.
- Author
- Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de
Definition at line 17 of file Decode.h.
◆ CDecode()
DirectGraphicalModels::CDecode::CDecode |
( |
CGraph & |
graph | ) |
|
|
inlineprotected |
Constructor.
- Parameters
-
Definition at line 24 of file Decode.h.
◆ ~CDecode()
virtual DirectGraphicalModels::CDecode::~CDecode |
( |
void |
| ) |
|
|
inlinevirtual |
◆ decode() [1/2]
virtual vec_byte_t DirectGraphicalModels::CDecode::decode |
( |
Mat & |
lossMatrix = EmptyMat | ) |
const |
|
inlinevirtual |
Approximate decoding.
This function estimates the most probable configuration of states (classes) in the graph, based on marginal probabilities in graph nodes.
- Parameters
-
lossMatrix | (optional) The loss matrix \(L\) (size: nStates x nStates; type: CV_32FC1). It must be a quadratic zero-diagonal matrix, whith all non-diagonal elements \(L_{i,j} > 0, \forall i\neq j\). The elemets \(L_{i,j}\) represent a loss if state \(j\) is classified as a state \(i\). |
- Returns
- The most probable configuration
Reimplemented in DirectGraphicalModels::CDecodeExact.
Definition at line 38 of file Decode.h.
◆ decode() [2/2]
vec_byte_t DirectGraphicalModels::CDecode::decode |
( |
const CGraph & |
graph, |
|
|
Mat & |
lossMatrix = EmptyMat |
|
) |
| |
|
static |
Approximate decoding.
This function estimates the most probable configuration of states (classes) in the graph, based on marginal probabilities in graph nodes.
- Parameters
-
graph | The graph |
lossMatrix | (optional) The loss matrix \(L\) (size: nStates x nStates; type: CV_32FC1). It must be a quadratic zero-diagonal matrix, whith all non-diagonal elements \(L_{i,j} > 0, \forall i\neq j\). The elemets \(L_{i,j}\) represent a loss if state \(j\) is classified as a state \(i\). |
- Returns
- The most probable configuration
Definition at line 7 of file Decode.cpp.
◆ getDefaultLossMatrix()
Mat DirectGraphicalModels::CDecode::getDefaultLossMatrix |
( |
byte |
nStates | ) |
|
|
static |
Returns a default loss matrix \(L\).
- Parameters
-
nStates | The number of States (classes) |
- Returns
- a loss matrix \(nStates\times nStates\): \(L=\left\{\begin{array}{rl}0&\mbox{if i = j}\\ 1&\mbox{otherwise}\end{array}\right.\) (size: nStates x nStates; type: CV_32FC1).
- Note
- Resulting loss matrix will cause no effect when using inside the decode() function. This function provides only a default matrix for further user modification before using in the decode() function.
Definition at line 28 of file Decode.cpp.
◆ getGraph()
CGraph& DirectGraphicalModels::CDecode::getGraph |
( |
void |
| ) |
const |
|
inlineprotected |
Returns the reference to the graph.
- Returns
- The reference to the graph
Definition at line 66 of file Decode.h.
◆ m_graph
CGraph& DirectGraphicalModels::CDecode::m_graph |
|
private |
The graph.
Definition at line 70 of file Decode.h.
The documentation for this class was generated from the following files: