From fb8478eb7b6c76f15c106c29a8843d8c3722bb62 Mon Sep 17 00:00:00 2001 From: Dikay900 Date: Fri, 20 Mar 2015 13:26:13 +0100 Subject: [PATCH] add resetting the offset variable after setting a new image --- modules/objdetect/src/cascadedetect.cpp | 4 ++++ modules/objdetect/src/cascadedetect.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index c4fedd46db..46a1d60f2d 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -677,6 +677,10 @@ void HaarEvaluator::computeOptFeatures() copyVectorToUMat(*optfeatures_lbuf, ufbuf); } +bool HaarEvaluator::setImage(InputArray _image, const std::vector& _scales){ + tofs = 0; + return FeatureEvaluator::setImage(_image, _scales); +} bool HaarEvaluator::setWindow( Point pt, int scaleIdx ) { diff --git a/modules/objdetect/src/cascadedetect.hpp b/modules/objdetect/src/cascadedetect.hpp index 4cbf3e9bf0..156f0468db 100644 --- a/modules/objdetect/src/cascadedetect.hpp +++ b/modules/objdetect/src/cascadedetect.hpp @@ -347,6 +347,7 @@ public: virtual Ptr clone() const; virtual int getFeatureType() const { return FeatureEvaluator::HAAR; } + virtual bool setImage(InputArray _image, const std::vector& _scales); virtual bool setWindow(Point p, int scaleIdx); Rect getNormRect() const; int getSquaresOffset() const;