Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
91dbcb33
Commit
91dbcb33
authored
Sep 08, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filled out spec
parent
cf8e0529
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
13 deletions
+30
-13
box_overlap_testing_abstract.h
dlib/image_processing/box_overlap_testing_abstract.h
+30
-13
No files found.
dlib/image_processing/box_overlap_testing_abstract.h
View file @
91dbcb33
...
...
@@ -12,30 +12,47 @@ namespace dlib
class
test_box_overlap
{
/*!
WHAT THIS OBJECT REPRESENTS
This object is a simple function object for determining if two rectangles
overlap.
!*/
public
:
test_box_overlap
(
)
:
overlap_thresh
(
0
.
5
)
{}
);
/*!
ensures
- #get_overlap_thresh() == 0.5
!*/
test_box_overlap
(
double
overlap_thresh_
)
:
overlap_thresh
(
overlap_thresh_
)
{}
double
overlap_thresh
);
/*!
requires
- 0 <= overlap_thresh <= 1
ensures
- #get_overlap_thresh() == overlap_thresh
!*/
bool
operator
()
(
const
dlib
::
rectangle
&
a
,
const
dlib
::
rectangle
&
b
)
const
{
const
double
inner
=
a
.
intersect
(
b
).
area
();
const
double
outer
=
(
a
+
b
).
area
();
if
(
inner
/
outer
>
overlap_thresh
)
return
true
;
else
return
false
;
}
)
const
;
/*!
ensures
- returns true if a.intersect(b).area()/(a+b).area > get_overlap_thresh()
and false otherwise. (i.e. returns true if a and b overlap enough)
!*/
double
get_overlap_thresh
(
)
const
;
/*!
ensures
- returns the threshold used to determine if two rectangles overlap.
!*/
};
...
...
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