virtual bool train( const CvMat* samples, const CvMat* sampleIdx=0,
CvEMParams params=CvEMParams(), CvMat* labels=0 );
- virtual float predict( const CvMat* sample, CV_OUT CvMat* probs, bool isNormalize=true ) const;
+ virtual float predict( const CvMat* sample, CV_OUT CvMat* probs ) const;
#ifndef SWIG
CV_WRAP CvEM( const cv::Mat& samples, const cv::Mat& sampleIdx=cv::Mat(),
CvEMParams params=CvEMParams(),
CV_OUT cv::Mat* labels=0 );
- CV_WRAP virtual float predict( const cv::Mat& sample, CV_OUT cv::Mat* probs=0, bool isNormalize=true ) const;
+ CV_WRAP virtual float predict( const cv::Mat& sample, CV_OUT cv::Mat* probs=0 ) const;
CV_WRAP virtual double calcLikelihood( const cv::Mat &sample ) const;
CV_WRAP int getNClusters() const;
}
float
-CvEM::predict( const CvMat* _sample, CvMat* _probs, bool isNormalize ) const
+CvEM::predict( const CvMat* _sample, CvMat* _probs ) const
{
Mat prbs0 = cvarrToMat(_probs), prbs = prbs0, sample = cvarrToMat(_sample);
int cls = emObj.predict(sample, _probs ? _OutputArray(prbs) : cv::noArray());
if(_probs)
{
- if(isNormalize)
- normalize(prbs, prbs, 1, 0, NORM_L1);
-
if( prbs.data != prbs0.data )
{
CV_Assert( prbs.size == prbs0.size );
}
float
-CvEM::predict( const Mat& _sample, Mat* _probs, bool isNormalize ) const
+CvEM::predict( const Mat& _sample, Mat* _probs ) const
{
int cls = emObj.predict(_sample, _probs ? _OutputArray(*_probs) : cv::noArray());
- if(_probs && isNormalize)
- normalize(*_probs, *_probs, 1, 0, NORM_L1);
-
return (float)cls;
}