Commit 4ff173aa authored by Davis King's avatar Davis King

Made the box overlap testing stuff a little more robust to differences in floating

point behavior on different compilers.  In particular, this change avoids having
false "impossible truth box" exceptions being thrown when the object detection
tools are used with the mingw gcc compiler.
parent 1b402f4f
...@@ -124,6 +124,13 @@ namespace dlib ...@@ -124,6 +124,13 @@ namespace dlib
} }
} }
// Relax these thresholds very slightly. We do this because on some systems the
// boxes that generated the max values erroneously trigger a box overlap match
// even though their overlap and match values are *equal* to the thresholds but not
// greater. That is, sometimes when double values get moved around they change
// their values slightly, so this avoids the problems that can create.
max_match_score = std::min(1.0000001*max_match_score, 1.0);
max_overlap = std::min(1.0000001*max_overlap, 1.0);
return test_box_overlap(max_match_score, max_overlap); return test_box_overlap(max_match_score, max_overlap);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment