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
40bab842
Commit
40bab842
authored
Mar 15, 2013
by
Davis King
Browse files
Added code to avoid a potential division by zero
parent
5977b0b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
dlib/image_processing/box_overlap_testing.h
dlib/image_processing/box_overlap_testing.h
+3
-0
No files found.
dlib/image_processing/box_overlap_testing.h
View file @
40bab842
...
@@ -42,6 +42,9 @@ namespace dlib
...
@@ -42,6 +42,9 @@ namespace dlib
)
const
)
const
{
{
const
double
inner
=
a
.
intersect
(
b
).
area
();
const
double
inner
=
a
.
intersect
(
b
).
area
();
if
(
inner
==
0
)
return
false
;
const
double
outer
=
(
a
+
b
).
area
();
const
double
outer
=
(
a
+
b
).
area
();
if
(
inner
/
outer
>
match_thresh
||
if
(
inner
/
outer
>
match_thresh
||
inner
/
a
.
area
()
>
overlap_thresh
||
inner
/
a
.
area
()
>
overlap_thresh
||
...
...
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