diff --git a/modules/xobjdetect/include/opencv2/xobjdetect.hpp b/modules/xobjdetect/include/opencv2/xobjdetect.hpp index 1ef62c93d..cc5da351a 100644 --- a/modules/xobjdetect/include/opencv2/xobjdetect.hpp +++ b/modules/xobjdetect/include/opencv2/xobjdetect.hpp @@ -147,7 +147,7 @@ public: Returns real value, sign(value) means class */ - float predict(int value); + float predict(int value) const; private: /* Stump decision threshold */ diff --git a/modules/xobjdetect/src/stump.cpp b/modules/xobjdetect/src/stump.cpp index 7c5f0baee..dd6e419a9 100644 --- a/modules/xobjdetect/src/stump.cpp +++ b/modules/xobjdetect/src/stump.cpp @@ -196,7 +196,7 @@ int Stump::train(const Mat& data, const Mat& labels, const Mat& weights) return min_row; } -float Stump::predict(int value) +float Stump::predict(int value) const { return polarity_ * (value - threshold_) > 0 ? pos_value_ : neg_value_; }