Direct Graphical Models  v.1.7.0
DirectGraphicalModels::CPriorEdge Class Reference

Edge prior probability estimation class. More...

#include <PriorEdge.h>

Inheritance diagram for DirectGraphicalModels::CPriorEdge:
Collaboration diagram for DirectGraphicalModels::CPriorEdge:

Public Member Functions

 CPriorEdge (byte nStates, ePotNormApproach normApp=eP_APP_NORM_SYMMETRIC)
 Constructor. More...
 
 ~CPriorEdge (void)
 
void addEdgeGroundTruth (byte gt1, byte gt2)
 Adds the groud-truth value to the co-occurance histogram matrix. More...
 
- Public Member Functions inherited from DirectGraphicalModels::CPrior
 CPrior (byte nStates, RandomModelType type)
 Constructor. More...
 
 ~CPrior (void)
 
void reset (void)
 Resets class variables. More...
 
Mat getPrior (float weight=1.0f) const
 Returns the prior probabilies. More...
 
- Public Member Functions inherited from DirectGraphicalModels::CBaseRandomModel
 CBaseRandomModel (byte nStates)
 Constructor. More...
 
virtual ~CBaseRandomModel (void)
 
virtual void save (const std::string &path, const std::string &name=std::string(), short idx=-1) const
 Saves the training data. More...
 
virtual void load (const std::string &path, const std::string &name=std::string(), short idx=-1)
 Loads the training data. More...
 
byte getNumStates (void) const
 Returns number of states (classes) More...
 

Protected Member Functions

Mat calculatePrior (void) const
 Returns the prior edge probability. More...
 
- Protected Member Functions inherited from DirectGraphicalModels::CPrior
virtual void saveFile (FILE *pFile) const
 Saves the random model into the file. More...
 
virtual void loadFile (FILE *pFile)
 Loads the random model from the file. More...
 
- Protected Member Functions inherited from DirectGraphicalModels::CBaseRandomModel
std::string generateFileName (const std::string &path, const std::string &name, short idx) const
 Generates name of the data file for storing random model parameters. More...
 

Private Attributes

ePotNormApproach m_normApp
 Flag specifying the co-occurance histogram matrix normalization approach (Ref. ePotNormApproach) More...
 

Additional Inherited Members

- Protected Attributes inherited from DirectGraphicalModels::CPrior
Mat m_histogramPrior
 The class cooccurance histogram. More...
 
- Protected Attributes inherited from DirectGraphicalModels::CBaseRandomModel
byte m_nStates
 The number of states (classes) More...
 

Detailed Description

Edge prior probability estimation class.

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 38 of file PriorEdge.h.

Constructor & Destructor Documentation

◆ CPriorEdge()

DirectGraphicalModels::CPriorEdge::CPriorEdge ( byte  nStates,
ePotNormApproach  normApp = eP_APP_NORM_SYMMETRIC 
)
inline

Constructor.

Parameters
nStatesNumber of states (classes)
normAppFlag specifying the co-occurance histogram matrix normalization approach (Ref. ePotNormApproach)

Definition at line 46 of file PriorEdge.h.

◆ ~CPriorEdge()

DirectGraphicalModels::CPriorEdge::~CPriorEdge ( void  )
inline

Definition at line 47 of file PriorEdge.h.

Member Function Documentation

◆ addEdgeGroundTruth()

void DirectGraphicalModels::CPriorEdge::addEdgeGroundTruth ( byte  gt1,
byte  gt2 
)

Adds the groud-truth value to the co-occurance histogram matrix.

Here gt1 is the X-coordinate of the co-occurance histogram matrix and gt2 - Y-coordinate of the co-occurance histogram matrix.

Parameters
gt1The ground-truth state (value) of the first node in edge.
gt2The ground-truth state (class) of the second node in edge.

Definition at line 6 of file PriorEdge.cpp.

Here is the caller graph for this function:

◆ calculatePrior()

Mat DirectGraphicalModels::CPriorEdge::calculatePrior ( void  ) const
protectedvirtual

Returns the prior edge probability.

This function returns the normalized class co-occurance histogram, which ought to be build during the training phase with help of the addEdgeGroundTruth() function. If the histogram was not built, this functions returns a uniform distribution "all ones".

Returns
Prior edge probability matrix: Mat(size: nStates x nStates; type: CV_32FC1)

Implements DirectGraphicalModels::CPrior.

Definition at line 13 of file PriorEdge.cpp.

Member Data Documentation

◆ m_normApp

ePotNormApproach DirectGraphicalModels::CPriorEdge::m_normApp
private

Flag specifying the co-occurance histogram matrix normalization approach (Ref. ePotNormApproach)

Definition at line 70 of file PriorEdge.h.


The documentation for this class was generated from the following files: