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
c590ee67
Commit
c590ee67
authored
Jun 21, 2015
by
Davis King
Browse files
Turned some DLIB_ASSERT() statements into DLIB_CASSERT() since it gives
better error reporting and is not a speed bottleneck.
parent
f0ccfd40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
dlib/image_processing/object_detector.h
dlib/image_processing/object_detector.h
+3
-5
No files found.
dlib/image_processing/object_detector.h
View file @
c590ee67
...
@@ -341,7 +341,7 @@ namespace dlib
...
@@ -341,7 +341,7 @@ namespace dlib
boxes_overlap
(
overlap_tester
)
boxes_overlap
(
overlap_tester
)
{
{
// make sure requires clause is not broken
// make sure requires clause is not broken
DLIB_ASSERT
(
scanner_
.
get_num_detection_templates
()
>
0
&&
w_
.
size
()
>
0
,
DLIB_
C
ASSERT
(
scanner_
.
get_num_detection_templates
()
>
0
&&
w_
.
size
()
>
0
,
"
\t
object_detector::object_detector(scanner_,overlap_tester,w_)"
"
\t
object_detector::object_detector(scanner_,overlap_tester,w_)"
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
scanner_.get_num_detection_templates(): "
<<
scanner_
.
get_num_detection_templates
()
<<
"
\n\t
scanner_.get_num_detection_templates(): "
<<
scanner_
.
get_num_detection_templates
()
...
@@ -349,10 +349,9 @@ namespace dlib
...
@@ -349,10 +349,9 @@ namespace dlib
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
this: "
<<
this
);
);
#ifdef ENABLE_ASSERTS
for
(
unsigned
long
i
=
0
;
i
<
w_
.
size
();
++
i
)
for
(
unsigned
long
i
=
0
;
i
<
w_
.
size
();
++
i
)
{
{
DLIB_ASSERT
(
w_
[
i
].
size
()
==
scanner_
.
get_num_dimensions
()
+
1
,
DLIB_
C
ASSERT
(
w_
[
i
].
size
()
==
scanner_
.
get_num_dimensions
()
+
1
,
"
\t
object_detector::object_detector(scanner_,overlap_tester,w_)"
"
\t
object_detector::object_detector(scanner_,overlap_tester,w_)"
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
scanner_.get_num_detection_templates(): "
<<
scanner_
.
get_num_detection_templates
()
<<
"
\n\t
scanner_.get_num_detection_templates(): "
<<
scanner_
.
get_num_detection_templates
()
...
@@ -361,7 +360,6 @@ namespace dlib
...
@@ -361,7 +360,6 @@ namespace dlib
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
this: "
<<
this
);
);
}
}
#endif
scanner
.
copy_configuration
(
scanner_
);
scanner
.
copy_configuration
(
scanner_
);
w
.
resize
(
w_
.
size
());
w
.
resize
(
w_
.
size
());
...
@@ -382,7 +380,7 @@ namespace dlib
...
@@ -382,7 +380,7 @@ namespace dlib
const
std
::
vector
<
object_detector
>&
detectors
const
std
::
vector
<
object_detector
>&
detectors
)
)
{
{
DLIB_ASSERT
(
detectors
.
size
()
!=
0
,
DLIB_
C
ASSERT
(
detectors
.
size
()
!=
0
,
"
\t
object_detector::object_detector(detectors)"
"
\t
object_detector::object_detector(detectors)"
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
this: "
<<
this
<<
"
\n\t
this: "
<<
this
...
...
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