Commit 718aa824dc581e43aa529d7e5e6837751c6e2f42

Authored by Brendan Klare
1 parent b9a0b5ea

Bug fixes

openbr/plugins/slidingwindow.cpp
... ... @@ -107,7 +107,6 @@ private:
107 107 return;
108 108 }
109 109  
110   - dst.file.clearRects();
111 110 Template windowTemplate(src.file, src);
112 111 QList<float> confidences = dst.file.getList<float>("Confidences", QList<float>());
113 112 for (float y = 0; y + windowHeight < src.m().rows; y += windowHeight*stepFraction) {
... ... @@ -273,13 +272,15 @@ private:
273 272 int rows = src.m().rows;
274 273 int cols = src.m().cols;
275 274 int windowHeight = (int) qRound((float) windowWidth / aspectRatio);
  275 +
276 276 float startScale;
277 277 if ((cols / rows) > aspectRatio)
278 278 startScale = qRound((float) rows / (float) windowHeight);
279 279 else
280 280 startScale = qRound((float) cols / (float) windowWidth);
  281 +
281 282 for (float scale = startScale; scale >= minScale; scale -= (1.0 - scaleFactor)) {
282   - Template scaleImg(src.file, Mat());
  283 + Template scaleImg(dst.file, Mat());
283 284 scaleImg.file.set("scale", scale);
284 285 resize(src, scaleImg, Size(qRound(cols / scale), qRound(rows / scale)));
285 286 transform->project(scaleImg, dst);
... ...