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
e57d4c28
Commit
e57d4c28
authored
Dec 24, 2011
by
Davis King
Browse files
Improved an error message.
parent
ac83daec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
dlib/svm/structural_svm_object_detection_problem.h
dlib/svm/structural_svm_object_detection_problem.h
+6
-3
No files found.
dlib/svm/structural_svm_object_detection_problem.h
View file @
e57d4c28
...
@@ -167,6 +167,10 @@ namespace dlib
...
@@ -167,6 +167,10 @@ namespace dlib
{
{
if
(
boxes_overlap
(
mapped_rects
[
i
],
mapped_rects
[
j
]))
if
(
boxes_overlap
(
mapped_rects
[
i
],
mapped_rects
[
j
]))
{
{
const
double
area_overlap
=
mapped_rects
[
i
].
intersect
(
mapped_rects
[
j
]).
area
();
const
double
match_amount
=
area_overlap
/
(
double
)(
mapped_rects
[
i
]
+
mapped_rects
[
j
]).
area
();
const
double
overlap_amount
=
area_overlap
/
std
::
min
(
mapped_rects
[
i
].
area
(),
mapped_rects
[
j
].
area
());
using
namespace
std
;
using
namespace
std
;
ostringstream
sout
;
ostringstream
sout
;
sout
<<
"An impossible set of object labels was detected. This is happening because "
;
sout
<<
"An impossible set of object labels was detected. This is happening because "
;
...
@@ -184,9 +188,8 @@ namespace dlib
...
@@ -184,9 +188,8 @@ namespace dlib
sout
<<
"The offending rectangles are:
\n
"
;
sout
<<
"The offending rectangles are:
\n
"
;
sout
<<
"rect1: "
<<
mapped_rects
[
i
]
<<
endl
;
sout
<<
"rect1: "
<<
mapped_rects
[
i
]
<<
endl
;
sout
<<
"rect2: "
<<
mapped_rects
[
j
]
<<
endl
;
sout
<<
"rect2: "
<<
mapped_rects
[
j
]
<<
endl
;
sout
<<
"overlap amount: "
<<
sout
<<
"match amount: "
<<
match_amount
<<
endl
;
mapped_rects
[
i
].
intersect
(
mapped_rects
[
j
]).
area
()
/
(
double
)(
mapped_rects
[
i
]
+
mapped_rects
[
j
]).
area
()
sout
<<
"overlap amount: "
<<
overlap_amount
<<
endl
;
<<
endl
;
throw
dlib
::
impossible_labeling_error
(
sout
.
str
());
throw
dlib
::
impossible_labeling_error
(
sout
.
str
());
}
}
}
}
...
...
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