Direct Graphical Models
v.1.7.0
|
Histogram-based PDF class (2D) More...
#include <PDFHistogram2D.h>
Public Member Functions | |
CPDFHistogram2D (void) | |
virtual | ~CPDFHistogram2D (void) |
virtual void | reset (void) |
Resets class variables. More... | |
virtual void | addPoint (Scalar point) |
Adds a sample point for PDF estimation. More... | |
virtual double | getDensity (Scalar point) |
Returns the probability density value for the argument point. More... | |
virtual Scalar | min (void) const |
Returns the lower argument boundary of the PDF. More... | |
virtual Scalar | max (void) const |
Returns the upper argument boundary of the PDF. More... | |
void | smooth (int nIt=1) |
Performs the gaussian smoothing on histogram. More... | |
Public Member Functions inherited from DirectGraphicalModels::IPDF | |
IPDF (void) | |
virtual | ~IPDF (void) |
bool | isEstimated (void) |
Checks weather the PDF was estimated. 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 | |
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 | |
long | m_data [256][256] |
Additional Inherited Members | |
Protected Attributes inherited from DirectGraphicalModels::IPDF | |
long | m_nPoints |
The number of samples, added with the addPoint() function. More... | |
Protected Attributes inherited from DirectGraphicalModels::CBaseRandomModel | |
byte | m_nStates |
The number of states (classes) More... | |
Histogram-based PDF class (2D)
This class makes use of distribution histograms in order to estimate the PDF. The length of the histogram is 255 x 255, thus arguments point of the addPoint() and getDensity() functions should be Scalar(a, b) , where a and b are 8-bit long values.
This class is curently used for test purposes. It works with 2-dimensional feature spaces only.
Definition at line 17 of file PDFHistogram2D.h.
DirectGraphicalModels::CPDFHistogram2D::CPDFHistogram2D | ( | void | ) |
Definition at line 6 of file PDFHistogram2D.cpp.
|
virtual |
Definition at line 12 of file PDFHistogram2D.cpp.
|
virtual |
Adds a sample point for PDF estimation.
point | The sample point. |
Implements DirectGraphicalModels::IPDF.
Definition at line 21 of file PDFHistogram2D.cpp.
|
virtual |
Returns the probability density value for the argument point.
point | The sample point. |
Implements DirectGraphicalModels::IPDF.
Definition at line 29 of file PDFHistogram2D.cpp.
|
protectedvirtual |
Loads the random model from the file.
Allows to re-use the class.
pFile | Pointer to the file, opened for reading. |
Implements DirectGraphicalModels::CBaseRandomModel.
Definition at line 53 of file PDFHistogram2D.cpp.
|
inlinevirtual |
Returns the upper argument boundary of the PDF.
Implements DirectGraphicalModels::IPDF.
Definition at line 28 of file PDFHistogram2D.h.
|
inlinevirtual |
Returns the lower argument boundary of the PDF.
Implements DirectGraphicalModels::IPDF.
Definition at line 27 of file PDFHistogram2D.h.
|
virtual |
Resets class variables.
Allows to re-use the class.
Implements DirectGraphicalModels::CBaseRandomModel.
Definition at line 15 of file PDFHistogram2D.cpp.
|
protectedvirtual |
Saves the random model into the file.
Allows to re-use the class.
pFile | Pointer to the file, opened for writing. |
Implements DirectGraphicalModels::CBaseRandomModel.
Definition at line 47 of file PDFHistogram2D.cpp.
void DirectGraphicalModels::CPDFHistogram2D::smooth | ( | int | nIt = 1 | ) |
Performs the gaussian smoothing on histogram.
Performs nIt iterations of gaussian smothing of the histograms in order to overcome the "over-fitting" problem
nIt | Number of iterations |
Definition at line 36 of file PDFHistogram2D.cpp.
|
private |
Definition at line 44 of file PDFHistogram2D.h.