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
b56f73ce
Commit
b56f73ce
authored
Sep 02, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added box_percent_covered()
parent
ac5206eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
box_overlap_testing.h
dlib/image_processing/box_overlap_testing.h
+23
-0
box_overlap_testing_abstract.h
dlib/image_processing/box_overlap_testing_abstract.h
+28
-0
No files found.
dlib/image_processing/box_overlap_testing.h
View file @
b56f73ce
...
@@ -34,6 +34,29 @@ namespace dlib
...
@@ -34,6 +34,29 @@ namespace dlib
return
box_intersection_over_union
(
drectangle
(
a
),
drectangle
(
b
));
return
box_intersection_over_union
(
drectangle
(
a
),
drectangle
(
b
));
}
}
// ----------------------------------------------------------------------------------------
inline
double
box_percent_covered
(
const
drectangle
&
a
,
const
drectangle
&
b
)
{
const
double
inner
=
a
.
intersect
(
b
).
area
();
if
(
inner
==
0
)
return
0
;
return
std
::
max
(
inner
/
a
.
area
(),
inner
/
b
.
area
());
}
// ----------------------------------------------------------------------------------------
inline
double
box_percent_covered
(
const
rectangle
&
a
,
const
rectangle
&
b
)
{
return
box_percent_covered
(
drectangle
(
a
),
drectangle
(
b
));
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
class
test_box_overlap
class
test_box_overlap
...
...
dlib/image_processing/box_overlap_testing_abstract.h
View file @
b56f73ce
...
@@ -32,6 +32,34 @@ namespace dlib
...
@@ -32,6 +32,34 @@ namespace dlib
boxes are empty then returns 0.
boxes are empty then returns 0.
!*/
!*/
// ----------------------------------------------------------------------------------------
inline
double
box_percent_covered
(
const
drectangle
&
a
,
const
drectangle
&
b
);
/*!
ensures
- let OVERLAP = a.intersect(b).area()
- This function returns max(OVERLAP/a.area(), OVERLAP/b.area())
e.g. If one box entirely contains another then this function returns 1, if
they don't overlap at all it returns 0.
!*/
// ----------------------------------------------------------------------------------------
inline
double
box_percent_covered
(
const
rectangle
&
a
,
const
rectangle
&
b
);
/*!
ensures
- let OVERLAP = a.intersect(b).area()
- This function returns max(OVERLAP/a.area(), OVERLAP/b.area())
e.g. If one box entirely contains another then this function returns 1, if
they don't overlap at all it returns 0.
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
class
test_box_overlap
class
test_box_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