mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Set a default value for the second argument of test_box_overlap's constructor.
Also added overlaps_any_box().
This commit is contained in:
parent
5d264ae5cd
commit
11e574ff97
@ -19,9 +19,9 @@ namespace dlib
|
||||
) : match_thresh(0.5), overlap_thresh(1.0)
|
||||
{}
|
||||
|
||||
test_box_overlap (
|
||||
explicit test_box_overlap (
|
||||
double match_thresh_,
|
||||
double overlap_thresh_
|
||||
double overlap_thresh_ = 1.0
|
||||
) : match_thresh(match_thresh_), overlap_thresh(overlap_thresh_)
|
||||
{
|
||||
// make sure requires clause is not broken
|
||||
@ -127,6 +127,22 @@ namespace dlib
|
||||
return test_box_overlap(max_match_score, max_overlap);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
inline bool overlaps_any_box (
|
||||
const test_box_overlap& tester,
|
||||
const std::vector<rectangle>& rects,
|
||||
const rectangle& rect
|
||||
)
|
||||
{
|
||||
for (unsigned long i = 0; i < rects.size(); ++i)
|
||||
{
|
||||
if (tester(rects[i],rect))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
@ -32,9 +32,9 @@ namespace dlib
|
||||
- #get_overlap_thresh() == 1.0
|
||||
!*/
|
||||
|
||||
test_box_overlap (
|
||||
explicit test_box_overlap (
|
||||
double match_thresh,
|
||||
double overlap_thresh
|
||||
double overlap_thresh = 1.0
|
||||
);
|
||||
/*!
|
||||
requires
|
||||
@ -117,6 +117,19 @@ namespace dlib
|
||||
- TBO(A,B) == false
|
||||
!*/
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
bool overlaps_any_box (
|
||||
const test_box_overlap& tester,
|
||||
const std::vector<rectangle>& rects,
|
||||
const rectangle& rect
|
||||
);
|
||||
/*!
|
||||
ensures
|
||||
- returns true if rect overlaps any box in rects and false otherwise. Overlap
|
||||
is determined based on the given tester object.
|
||||
!*/
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user