| 20 | namespace impl |
| 21 | { |
| 22 | inline bool matches_rect ( |
| 23 | const std::vector<rectangle>& rects, |
| 24 | const rectangle& rect, |
| 25 | const double eps |
| 26 | ) |
| 27 | { |
| 28 | for (unsigned long i = 0; i < rects.size(); ++i) |
| 29 | { |
| 30 | const double score = (rect.intersect(rects[i])).area()/(double)(rect+rects[i]).area(); |
| 31 | if (score > eps) |
| 32 | return true; |
| 33 | } |
| 34 | |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | inline rectangle get_best_matching_rect ( |
| 39 | const std::vector<rectangle>& rects, |
no test coverage detected