removed unnecessary param

This commit is contained in:
Maria Dimashova 2012-04-11 13:48:20 +00:00
parent d8cec20e1b
commit 3db7823682
2 changed files with 4 additions and 10 deletions

View File

@ -1806,7 +1806,7 @@ public:
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(),
@ -1817,7 +1817,7 @@ public:
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;

View File

@ -102,15 +102,12 @@ double CvEM::calcLikelihood( const Mat &input_sample ) 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 );
@ -236,12 +233,9 @@ bool CvEM::train( const Mat& _samples, const Mat& _sample_idx,
}
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;
}