Templated Belief Propagation Class. More...
#include <belief.h>
Public Member Functions | |
BeliefProp (int w, int h) | |
Constructor. | |
void | ComputeMAP (Image< unsigned char > &mask) |
Compute Posterior with Graph Cuts. | |
void | Execute (int loops) |
Perform Belief Propagation. | |
void | Execute (int loops, int depth) |
Perform Belief Propagation. | |
float ** | GetBeliefs () |
Get labelling beliefs. | |
float ** | GetPriors () |
Get Prior probabilities. | |
void | SetGradientCosts (Image< unsigned char > &img, float gamma) |
Set the gradient costs. | |
~BeliefProp () | |
Private Member Functions | |
void | ComputeBeliefs () |
Compute the Beliefs. | |
void | InitMessages () |
Initialise the Messages. | |
void | UpdateMessages () |
Update the Messages. | |
Private Attributes | |
float * | belief [dim] |
Labeling beliefs. | |
float * | costh |
horizontal costs | |
float * | costv |
vertical costs | |
int | height |
Image height. | |
float * | msgd [dim] |
Messages down. | |
float * | msgl [dim] |
Messages to left. | |
float * | msgr [dim] |
Messages to right. | |
float * | msgu [dim] |
Messages up. | |
float * | prior [dim] |
Prior probabilities. | |
int | width |
Image width. |
Templated Belief Propagation Class.
Performs loopy belief propagation on CPU
dim | Number of hypotheses |
BeliefProp< dim >::BeliefProp | ( | int | w, |
int | h | ||
) |
BeliefProp< dim >::~BeliefProp | ( | ) |
Definition at line 55 of file belief.cpp.
void BeliefProp< dim >::ComputeBeliefs | ( | ) | [private] |
Compute the Beliefs.
Definition at line 188 of file belief.cpp.
void BeliefProp< dim >::ComputeMAP | ( | Image< unsigned char > & | mask | ) |
Compute Posterior with Graph Cuts.
Compute Posterior with Graph Cuts (Not used right now)
mask | Not used right now |
void BeliefProp< dim >::Execute | ( | int | loops | ) |
Perform Belief Propagation.
Perform loopy belief propagation on CPU
loops | Number of iterations |
Definition at line 114 of file belief.cpp.
void BeliefProp< dim >::Execute | ( | int | loops, |
int | depth | ||
) |
Perform Belief Propagation.
Perform loopy belief propagation on CPU
loops | Number of iterations |
depth | Depth of Propagation |
Definition at line 122 of file belief.cpp.
float ** BeliefProp< dim >::GetBeliefs | ( | ) |
float ** BeliefProp< dim >::GetPriors | ( | ) |
void BeliefProp< dim >::InitMessages | ( | ) | [private] |
Initialise the Messages.
Definition at line 177 of file belief.cpp.
void BeliefProp< dim >::SetGradientCosts | ( | Image< unsigned char > & | img, |
float | gamma | ||
) |
Set the gradient costs.
img | Gray-level image |
gamma | Gradient weight |
Definition at line 79 of file belief.cpp.
void BeliefProp< dim >::UpdateMessages | ( | ) | [private] |
Update the Messages.
Definition at line 195 of file belief.cpp.
float* BeliefProp< dim >::belief[dim] [private] |
float* BeliefProp< dim >::costh [private] |
float* BeliefProp< dim >::costv [private] |
int BeliefProp< dim >::height [private] |
float* BeliefProp< dim >::msgd[dim] [private] |
float* BeliefProp< dim >::msgl[dim] [private] |
float* BeliefProp< dim >::msgr[dim] [private] |
float* BeliefProp< dim >::msgu[dim] [private] |
float* BeliefProp< dim >::prior[dim] [private] |
int BeliefProp< dim >::width [private] |