From 03d7443a1f28dd8cfe9012cc06e7ba99b48fb84a Mon Sep 17 00:00:00 2001 From: Austin Van Blanton Date: Tue, 3 Sep 2013 15:11:49 -0400 Subject: [PATCH] Fix random negative samples size --- openbr/plugins/slidingwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbr/plugins/slidingwindow.cpp b/openbr/plugins/slidingwindow.cpp index 58a8ac3..828bf43 100644 --- a/openbr/plugins/slidingwindow.cpp +++ b/openbr/plugins/slidingwindow.cpp @@ -55,7 +55,7 @@ private: int y = Common::RandSample(1, m.rows)[0]; int maxWidth = m.cols - x, maxHeight = m.rows - y; int maxSize = std::min(maxWidth, maxHeight); - int size = (maxSize < minSize ? maxSize : Common::RandSample(1, maxSize, minSize)[0]); + int size = (maxSize <= minSize ? maxSize : Common::RandSample(1, maxSize, minSize)[0]); Rect negRect(x, y, size, size); Rect intersect = negRect & rect; if (intersect.area() > maxOverlap*rect.area()) -- libgit2 0.21.4