Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
11e574ff
Commit
11e574ff
authored
Nov 23, 2013
by
Davis King
Browse files
Set a default value for the second argument of test_box_overlap's constructor.
Also added overlaps_any_box().
parent
5d264ae5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
dlib/image_processing/box_overlap_testing.h
dlib/image_processing/box_overlap_testing.h
+18
-2
dlib/image_processing/box_overlap_testing_abstract.h
dlib/image_processing/box_overlap_testing_abstract.h
+15
-2
No files found.
dlib/image_processing/box_overlap_testing.h
View file @
11e574ff
...
@@ -19,9 +19,9 @@ namespace dlib
...
@@ -19,9 +19,9 @@ namespace dlib
)
:
match_thresh
(
0.5
),
overlap_thresh
(
1.0
)
)
:
match_thresh
(
0.5
),
overlap_thresh
(
1.0
)
{}
{}
test_box_overlap
(
explicit
test_box_overlap
(
double
match_thresh_
,
double
match_thresh_
,
double
overlap_thresh_
double
overlap_thresh_
=
1.0
)
:
match_thresh
(
match_thresh_
),
overlap_thresh
(
overlap_thresh_
)
)
:
match_thresh
(
match_thresh_
),
overlap_thresh
(
overlap_thresh_
)
{
{
// make sure requires clause is not broken
// make sure requires clause is not broken
...
@@ -127,6 +127,22 @@ namespace dlib
...
@@ -127,6 +127,22 @@ namespace dlib
return
test_box_overlap
(
max_match_score
,
max_overlap
);
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
;
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
}
}
...
...
dlib/image_processing/box_overlap_testing_abstract.h
View file @
11e574ff
...
@@ -32,9 +32,9 @@ namespace dlib
...
@@ -32,9 +32,9 @@ namespace dlib
- #get_overlap_thresh() == 1.0
- #get_overlap_thresh() == 1.0
!*/
!*/
test_box_overlap
(
explicit
test_box_overlap
(
double
match_thresh
,
double
match_thresh
,
double
overlap_thresh
double
overlap_thresh
=
1.0
);
);
/*!
/*!
requires
requires
...
@@ -117,6 +117,19 @@ namespace dlib
...
@@ -117,6 +117,19 @@ namespace dlib
- TBO(A,B) == false
- 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.
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment