From: Maria Dimashova Date: Wed, 11 Apr 2012 13:48:20 +0000 (+0000) Subject: removed unnecessary param X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~2130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3db78236826b9cdf875d740e3b22a82a1b041a11;p=platform%2Fupstream%2Fopencv.git removed unnecessary param --- diff --git a/modules/legacy/include/opencv2/legacy/legacy.hpp b/modules/legacy/include/opencv2/legacy/legacy.hpp index 36e8487..8df5a23 100644 --- a/modules/legacy/include/opencv2/legacy/legacy.hpp +++ b/modules/legacy/include/opencv2/legacy/legacy.hpp @@ -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; diff --git a/modules/legacy/src/em.cpp b/modules/legacy/src/em.cpp index dbf774d..543df09 100644 --- a/modules/legacy/src/em.cpp +++ b/modules/legacy/src/em.cpp @@ -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; }