From: Alexander Alekhin Date: Sat, 5 Sep 2020 18:53:51 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/3.4' into merge-3.4 X-Git-Tag: submit/tizen/20210224.033012~2^2~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c76f99fdd3b5aa50a9f6198320416fedb2f76fc;p=platform%2Fupstream%2Fopencv.git Merge remote-tracking branch 'upstream/3.4' into merge-3.4 --- 5c76f99fdd3b5aa50a9f6198320416fedb2f76fc diff --cc modules/ml/include/opencv2/ml.hpp index 7fdb460,396a792..d537ab7 --- a/modules/ml/include/opencv2/ml.hpp +++ b/modules/ml/include/opencv2/ml.hpp @@@ -1292,8 -1292,17 +1292,17 @@@ public @param results Array where the result of the calculation will be written. @param flags Flags for defining the type of RTrees. */ - CV_WRAP void getVotes(InputArray samples, OutputArray results, int flags) const; + CV_WRAP virtual void getVotes(InputArray samples, OutputArray results, int flags) const = 0; + /** Returns the OOB error value, computed at the training stage when calcOOBError is set to true. + * If this flag was set to false, 0 is returned. The OOB error is also scaled by sample weighting. + */ -#if CV_VERSION_MAJOR == 3 - CV_WRAP double getOOBError() const; ++#if CV_VERSION_MAJOR == 4 ++ CV_WRAP virtual double getOOBError() const { return 0; } + #else + /*CV_WRAP*/ virtual double getOOBError() const = 0; + #endif + /** Creates the empty model. Use StatModel::train to train the model, StatModel::train to create and train the model, Algorithm::load to load the pre-trained model. diff --cc modules/ml/src/rtrees.cpp index 9c7ec4f,1deee6f..216b42b --- a/modules/ml/src/rtrees.cpp +++ b/modules/ml/src/rtrees.cpp @@@ -500,6 -510,12 +505,8 @@@ public const vector& getNodes() const CV_OVERRIDE { return impl.getNodes(); } const vector& getSplits() const CV_OVERRIDE { return impl.getSplits(); } const vector& getSubsets() const CV_OVERRIDE { return impl.getSubsets(); } -#if CV_VERSION_MAJOR == 3 - double getOOBError_() const { return impl.getOOBError(); } -#else + double getOOBError() const CV_OVERRIDE { return impl.getOOBError(); } -#endif + DTreesImplForRTrees impl; };