From 718aa824dc581e43aa529d7e5e6837751c6e2f42 Mon Sep 17 00:00:00 2001 From: Brendan Klare Date: Tue, 10 Dec 2013 23:49:46 -0500 Subject: [PATCH] Bug fixes --- openbr/plugins/slidingwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openbr/plugins/slidingwindow.cpp b/openbr/plugins/slidingwindow.cpp index ddc8578..5cabca2 100644 --- a/openbr/plugins/slidingwindow.cpp +++ b/openbr/plugins/slidingwindow.cpp @@ -107,7 +107,6 @@ private: return; } - dst.file.clearRects(); Template windowTemplate(src.file, src); QList confidences = dst.file.getList("Confidences", QList()); for (float y = 0; y + windowHeight < src.m().rows; y += windowHeight*stepFraction) { @@ -273,13 +272,15 @@ private: int rows = src.m().rows; int cols = src.m().cols; int windowHeight = (int) qRound((float) windowWidth / aspectRatio); + float startScale; if ((cols / rows) > aspectRatio) startScale = qRound((float) rows / (float) windowHeight); else startScale = qRound((float) cols / (float) windowWidth); + for (float scale = startScale; scale >= minScale; scale -= (1.0 - scaleFactor)) { - Template scaleImg(src.file, Mat()); + Template scaleImg(dst.file, Mat()); scaleImg.file.set("scale", scale); resize(src, scaleImg, Size(qRound(cols / scale), qRound(rows / scale))); transform->project(scaleImg, dst); -- libgit2 0.21.4