From 919686ebdc7a5733865c68497e6fbff972201ea2 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Thu, 14 Nov 2013 16:40:12 -0500 Subject: [PATCH] factored out the common code needed for IntegralSlidingWindowTransform --- openbr/plugins/slidingwindow.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/openbr/plugins/slidingwindow.cpp b/openbr/plugins/slidingwindow.cpp index 4dc8a3b..feaa55e 100644 --- a/openbr/plugins/slidingwindow.cpp +++ b/openbr/plugins/slidingwindow.cpp @@ -78,15 +78,20 @@ private: stream >> windowHeight; } -protected: // Let IntegralSlidingWindowTransform access this void project(const Template &src, Template &dst) const { + float scale = src.file.get("scale", 1); + projectHelp(src, dst, windowWidth, windowHeight, scale); + } + +protected: // Let IntegralSlidingWindowTransform access this + void projectHelp(const Template &src, Template &dst, int windowWidth, int windowHeight, float scale = 1) const + { dst = src; // no need to slide a window over ground truth data if (src.file.getBool("Train", false)) return; dst.file.clearRects(); - float scale = src.file.get("scale", 1); Template windowTemplate(src.file, src); QList confidences = dst.file.getList("Confidences", QList()); for (float y = 0; y + windowHeight < src.m().rows; y += windowHeight*stepFraction) { @@ -125,7 +130,7 @@ class IntegralSlidingWindowTransform : public SlidingWindowTransform void project(const Template &src, Template &dst) const { // TODO: call SlidingWindowTransform::project on multiple scales - SlidingWindowTransform::project(src, dst); + SlidingWindowTransform::projectHelp(src, dst, 24, 24); } }; -- libgit2 0.21.4