From 0865227049b465bc61dc104627dbbf50611f3436 Mon Sep 17 00:00:00 2001 From: "marina.kolpakova" Date: Wed, 14 Nov 2012 20:28:08 +0400 Subject: [PATCH] check if scaling values changed --- modules/gpu/src/softcascade.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/gpu/src/softcascade.cpp b/modules/gpu/src/softcascade.cpp index 7f5221f374..bf543150b1 100644 --- a/modules/gpu/src/softcascade.cpp +++ b/modules/gpu/src/softcascade.cpp @@ -248,6 +248,17 @@ struct cv::gpu::SCascade::Fields return fields; } + bool check(float mins,float maxs, int scales) + { + bool updated = (minScale == mins) || (maxScale == maxs) || (totals = scales); + + minScale = mins; + maxScale = maxScale; + totals = scales; + + return updated; + } + int createLevels(const int fh, const int fw) { using namespace device::icf; @@ -509,7 +520,7 @@ void cv::gpu::SCascade::detect(InputArray image, InputArray _rois, OutputArray _ if (colored.type() == CV_8UC3) { - if (!flds.update(colored.rows, colored.cols, flds.shrinkage)) + if (!flds.update(colored.rows, colored.cols, flds.shrinkage) || flds.check(minScale, maxScale, scales)) flds.createLevels(colored.rows, colored.cols); flds.preprocess(colored, s); }