OpenCV  2.4.13.2
Open Source Computer Vision
cv::EM Class Reference

#include <ml.hpp>

Inheritance diagram for cv::EM:
cv::Algorithm

Public Types

enum  { COV_MAT_SPHERICAL =0, COV_MAT_DIAGONAL =1, COV_MAT_GENERIC =2, COV_MAT_DEFAULT =COV_MAT_DIAGONAL }
 
enum  { DEFAULT_NCLUSTERS =5, DEFAULT_MAX_ITERS =100 }
 
enum  { START_E_STEP =1, START_M_STEP =2, START_AUTO_STEP =0 }
 
- Public Types inherited from cv::Algorithm
typedef Algorithm *(* Constructor) (void)
 
typedef int(Algorithm::* Getter) () const
 
typedef void(Algorithm::* Setter) (int)
 

Public Member Functions

 EM (int nclusters=EM::DEFAULT_NCLUSTERS, int covMatType=EM::COV_MAT_DIAGONAL, const TermCriteria &termCrit=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, EM::DEFAULT_MAX_ITERS, FLT_EPSILON))
 
virtual ~EM ()
 
virtual void clear ()
 
virtual bool train (InputArray samples, OutputArray logLikelihoods=noArray(), OutputArray labels=noArray(), OutputArray probs=noArray())
 
virtual bool trainE (InputArray samples, InputArray means0, InputArray covs0=noArray(), InputArray weights0=noArray(), OutputArray logLikelihoods=noArray(), OutputArray labels=noArray(), OutputArray probs=noArray())
 
virtual bool trainM (InputArray samples, InputArray probs0, OutputArray logLikelihoods=noArray(), OutputArray labels=noArray(), OutputArray probs=noArray())
 
Vec2d predict (InputArray sample, OutputArray probs=noArray()) const
 
bool isTrained () const
 
AlgorithmInfoinfo () const
 
virtual void read (const FileNode &fn)
 
- Public Member Functions inherited from cv::Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
string name () const
 
template<typename _Tp >
ParamType< _Tp >::member_type get (const string &name) const
 
template<typename _Tp >
ParamType< _Tp >::member_type get (const char *name) const
 
int getInt (const string &name) const
 
double getDouble (const string &name) const
 
bool getBool (const string &name) const
 
string getString (const string &name) const
 
Mat getMat (const string &name) const
 
vector< MatgetMatVector (const string &name) const
 
Ptr< AlgorithmgetAlgorithm (const string &name) const
 
void set (const string &name, int value)
 
void set (const string &name, double value)
 
void set (const string &name, bool value)
 
void set (const string &name, const string &value)
 
void set (const string &name, const Mat &value)
 
void set (const string &name, const vector< Mat > &value)
 
void set (const string &name, const Ptr< Algorithm > &value)
 
template<typename _Tp >
void set (const string &name, const Ptr< _Tp > &value)
 
void setInt (const string &name, int value)
 
void setDouble (const string &name, double value)
 
void setBool (const string &name, bool value)
 
void setString (const string &name, const string &value)
 
void setMat (const string &name, const Mat &value)
 
void setMatVector (const string &name, const vector< Mat > &value)
 
void setAlgorithm (const string &name, const Ptr< Algorithm > &value)
 
template<typename _Tp >
void setAlgorithm (const string &name, const Ptr< _Tp > &value)
 
void set (const char *name, int value)
 
void set (const char *name, double value)
 
void set (const char *name, bool value)
 
void set (const char *name, const string &value)
 
void set (const char *name, const Mat &value)
 
void set (const char *name, const vector< Mat > &value)
 
void set (const char *name, const Ptr< Algorithm > &value)
 
template<typename _Tp >
void set (const char *name, const Ptr< _Tp > &value)
 
void setInt (const char *name, int value)
 
void setDouble (const char *name, double value)
 
void setBool (const char *name, bool value)
 
void setString (const char *name, const string &value)
 
void setMat (const char *name, const Mat &value)
 
void setMatVector (const char *name, const vector< Mat > &value)
 
void setAlgorithm (const char *name, const Ptr< Algorithm > &value)
 
template<typename _Tp >
void setAlgorithm (const char *name, const Ptr< _Tp > &value)
 
string paramHelp (const string &name) const
 
int paramType (const char *name) const
 
int paramType (const string &name) const
 
void getParams (CV_OUT vector< string > &names) const
 
virtual void write (FileStorage &fs) const
 

Protected Member Functions

virtual void setTrainData (int startStep, const Mat &samples, const Mat *probs0, const Mat *means0, const vector< Mat > *covs0, const Mat *weights0)
 
bool doTrain (int startStep, OutputArray logLikelihoods, OutputArray labels, OutputArray probs)
 
virtual void eStep ()
 
virtual void mStep ()
 
void clusterTrainSamples ()
 
void decomposeCovs ()
 
void computeLogWeightDivDet ()
 
Vec2d computeProbabilities (const Mat &sample, Mat *probs) const
 

Protected Attributes

int nclusters
 
int covMatType
 
int maxIters
 
double epsilon
 
Mat trainSamples
 
Mat trainProbs
 
Mat trainLogLikelihoods
 
Mat trainLabels
 
CV_PROP Mat weights
 
CV_PROP Mat means
 
CV_PROP vector< Matcovs
 
vector< MatcovsEigenValues
 
vector< MatcovsRotateMats
 
vector< MatinvCovsEigenValues
 
Mat logWeightDivDet
 

Additional Inherited Members

- Static Public Member Functions inherited from cv::Algorithm
static void getList (CV_OUT vector< string > &algorithms)
 
static Ptr< Algorithm_create (const string &name)
 
template<typename _Tp >
static Ptr< _Tp > create (const string &name)
 

Member Enumeration Documentation

§ anonymous enum

anonymous enum
Enumerator
COV_MAT_SPHERICAL 
COV_MAT_DIAGONAL 
COV_MAT_GENERIC 
COV_MAT_DEFAULT 

§ anonymous enum

anonymous enum
Enumerator
DEFAULT_NCLUSTERS 
DEFAULT_MAX_ITERS 

§ anonymous enum

anonymous enum
Enumerator
START_E_STEP 
START_M_STEP 
START_AUTO_STEP 

Constructor & Destructor Documentation

§ EM()

cv::EM::EM ( int  nclusters = EM::DEFAULT_NCLUSTERS,
int  covMatType = EM::COV_MAT_DIAGONAL,
const TermCriteria termCrit = TermCriteria(TermCriteria::COUNT+TermCriteria::EPSEM::DEFAULT_MAX_ITERS, FLT_EPSILON) 
)

§ ~EM()

virtual cv::EM::~EM ( )
virtual

Member Function Documentation

§ clear()

virtual void cv::EM::clear ( )
virtual

§ clusterTrainSamples()

void cv::EM::clusterTrainSamples ( )
protected

§ computeLogWeightDivDet()

void cv::EM::computeLogWeightDivDet ( )
protected

§ computeProbabilities()

Vec2d cv::EM::computeProbabilities ( const Mat sample,
Mat probs 
) const
protected

§ decomposeCovs()

void cv::EM::decomposeCovs ( )
protected

§ doTrain()

bool cv::EM::doTrain ( int  startStep,
OutputArray  logLikelihoods,
OutputArray  labels,
OutputArray  probs 
)
protected

§ eStep()

virtual void cv::EM::eStep ( )
protectedvirtual

§ info()

AlgorithmInfo* cv::EM::info ( ) const
virtual

Reimplemented from cv::Algorithm.

§ isTrained()

bool cv::EM::isTrained ( ) const

§ mStep()

virtual void cv::EM::mStep ( )
protectedvirtual

§ predict()

Vec2d cv::EM::predict ( InputArray  sample,
OutputArray  probs = noArray() 
) const

§ read()

virtual void cv::EM::read ( const FileNode fn)
virtual

Reimplemented from cv::Algorithm.

§ setTrainData()

virtual void cv::EM::setTrainData ( int  startStep,
const Mat samples,
const Mat probs0,
const Mat means0,
const vector< Mat > *  covs0,
const Mat weights0 
)
protectedvirtual

§ train()

virtual bool cv::EM::train ( InputArray  samples,
OutputArray  logLikelihoods = noArray(),
OutputArray  labels = noArray(),
OutputArray  probs = noArray() 
)
virtual

§ trainE()

virtual bool cv::EM::trainE ( InputArray  samples,
InputArray  means0,
InputArray  covs0 = noArray(),
InputArray  weights0 = noArray(),
OutputArray  logLikelihoods = noArray(),
OutputArray  labels = noArray(),
OutputArray  probs = noArray() 
)
virtual

§ trainM()

virtual bool cv::EM::trainM ( InputArray  samples,
InputArray  probs0,
OutputArray  logLikelihoods = noArray(),
OutputArray  labels = noArray(),
OutputArray  probs = noArray() 
)
virtual

Member Data Documentation

§ covMatType

int cv::EM::covMatType
protected

§ covs

CV_PROP vector<Mat> cv::EM::covs
protected

§ covsEigenValues

vector<Mat> cv::EM::covsEigenValues
protected

§ covsRotateMats

vector<Mat> cv::EM::covsRotateMats
protected

§ epsilon

double cv::EM::epsilon
protected

§ invCovsEigenValues

vector<Mat> cv::EM::invCovsEigenValues
protected

§ logWeightDivDet

Mat cv::EM::logWeightDivDet
protected

§ maxIters

int cv::EM::maxIters
protected

§ means

CV_PROP Mat cv::EM::means
protected

§ nclusters

int cv::EM::nclusters
protected

§ trainLabels

Mat cv::EM::trainLabels
protected

§ trainLogLikelihoods

Mat cv::EM::trainLogLikelihoods
protected

§ trainProbs

Mat cv::EM::trainProbs
protected

§ trainSamples

Mat cv::EM::trainSamples
protected

§ weights

CV_PROP Mat cv::EM::weights
protected

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