Commit d3c0490fd2626d671df66abcfcd4ac05067a9a33

Authored by Brendan Klare
1 parent c11e9eec

Ignore border fix

openbr/plugins/slidingwindow.cpp
... ... @@ -46,7 +46,7 @@ class SlidingWindowTransform : public Transform
46 46 Q_PROPERTY(bool takeFirst READ get_takeFirst WRITE set_takeFirst RESET reset_takeFirst STORED false)
47 47 Q_PROPERTY(float threshold READ get_threshold WRITE set_threshold RESET reset_threshold STORED false)
48 48 Q_PROPERTY(float stepFraction READ get_stepFraction WRITE set_stepFraction RESET reset_stepFraction STORED false)
49   - Q_PROPERTY(int ignoreBorder READ get_ignoreBorder WRITE set_ignoreBorder RESET reset_ignoreBorder STORED false)
  49 + Q_PROPERTY(int ignoreBorder READ get_ignoreBorder WRITE set_ignoreBorder RESET reset_ignoreBorder STORED true)
50 50 BR_PROPERTY(br::Transform *, transform, NULL)
51 51 BR_PROPERTY(int, windowWidth, 24)
52 52 BR_PROPERTY(bool, takeFirst, false)
... ... @@ -112,7 +112,7 @@ private:
112 112 QList<float> confidences = dst.file.getList<float>("Confidences", QList<float>());
113 113 for (float y = 0; y + windowHeight < src.m().rows; y += windowHeight*stepFraction) {
114 114 for (float x = 0; x + windowWidth < src.m().cols; x += windowWidth*stepFraction) {
115   - Mat windowMat(src, Rect(x, y, windowWidth, windowHeight));
  115 + Mat windowMat(src, Rect(x + ignoreBorder, y + ignoreBorder, windowWidth - ignoreBorder * 2, windowHeight - ignoreBorder * 2));
116 116 windowTemplate.replace(0,windowMat);
117 117 Template detect;
118 118 transform->project(windowTemplate, detect);
... ... @@ -269,7 +269,6 @@ private:
269 269 dst = src;
270 270 return;
271 271 }
272   - if (src.file.getBool("Train", false)) return;
273 272  
274 273 int rows = src.m().rows;
275 274 int cols = src.m().cols;
... ...