Commit 0a8576dc8e4e136126cdf508a8b9fa05bec1e221

Authored by Austin Van Blanton
1 parent 5c411444

x, y, and size should be doubles (stepSize and scaleFactor are doubles)

openbr/plugins/slidingwindow.cpp
@@ -75,9 +75,9 @@ private: @@ -75,9 +75,9 @@ private:
75 void project(const Template &src, Template &dst) const 75 void project(const Template &src, Template &dst) const
76 { 76 {
77 int rows = src.m().rows, cols = src.m().cols; 77 int rows = src.m().rows, cols = src.m().cols;
78 - for (int size=std::min(rows, cols); size>=minSize; size*=scaleFactor) {  
79 - for (int y=0; y+size<rows; y+=(size*stepSize)) {  
80 - for (int x=0; x+size>cols; x+=(size*stepSize)) { 78 + for (double size=std::min(rows, cols); size>=minSize; size*=scaleFactor) {
  79 + for (double y=0; y+size<rows; y+=(size*stepSize)) {
  80 + for (double x=0; x+size>cols; x+=(size*stepSize)) {
81 Template window(src.file, Mat(src.m(), Rect(x, y, size, size))); 81 Template window(src.file, Mat(src.m(), Rect(x, y, size, size)));
82 Template detect; 82 Template detect;
83 transform->project(window, detect); 83 transform->project(window, detect);