Simplified code slightly.

This commit is contained in:
Davis King 2013-11-23 19:55:44 -05:00
parent 77f6c9f27e
commit 363d505c10
1 changed files with 2 additions and 15 deletions

View File

@ -334,7 +334,7 @@ namespace dlib
// The point of this loop is to fill out the truth_score_hits array. // The point of this loop is to fill out the truth_score_hits array.
for (unsigned long i = 0; i < dets.size() && final_dets.size() < max_num_dets; ++i) for (unsigned long i = 0; i < dets.size() && final_dets.size() < max_num_dets; ++i)
{ {
if (overlaps_any_box(final_dets, dets[i].second)) if (overlaps_any_box(boxes_overlap, final_dets, dets[i].second))
continue; continue;
const std::pair<double,unsigned int> truth = find_best_match(truth_object_detections[idx], dets[i].second); const std::pair<double,unsigned int> truth = find_best_match(truth_object_detections[idx], dets[i].second);
@ -371,7 +371,7 @@ namespace dlib
// detections. // detections.
for (unsigned long i = 0; i < dets.size() && final_dets.size() < max_num_dets; ++i) for (unsigned long i = 0; i < dets.size() && final_dets.size() < max_num_dets; ++i)
{ {
if (overlaps_any_box(final_dets, dets[i].second)) if (overlaps_any_box(boxes_overlap, final_dets, dets[i].second))
continue; continue;
const std::pair<double,unsigned int> truth = find_best_match(truth_object_detections[idx], dets[i].second); const std::pair<double,unsigned int> truth = find_best_match(truth_object_detections[idx], dets[i].second);
@ -431,19 +431,6 @@ namespace dlib
} }
bool overlaps_any_box (
const std::vector<rectangle>& truth_object_detections,
const dlib::rectangle& rect
) const
{
for (unsigned long i = 0; i < truth_object_detections.size(); ++i)
{
if (boxes_overlap(truth_object_detections[i], rect))
return true;
}
return false;
}
bool overlaps_ignore_box ( bool overlaps_ignore_box (
const long idx, const long idx,
const dlib::rectangle& rect const dlib::rectangle& rect