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
2384f6cc
Commit
2384f6cc
authored
Nov 17, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing asserts
parent
17a46669
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
7 deletions
+55
-7
scan_fhog_pyramid.h
dlib/image_processing/scan_fhog_pyramid.h
+54
-6
scan_fhog_pyramid_abstract.h
dlib/image_processing/scan_fhog_pyramid_abstract.h
+1
-1
No files found.
dlib/image_processing/scan_fhog_pyramid.h
View file @
2384f6cc
...
...
@@ -49,6 +49,15 @@ namespace dlib
unsigned
long
height
)
{
// make sure requires clause is not broken
DLIB_ASSERT
(
width
>
0
&&
height
>
0
,
"
\t
void scan_fhog_pyramid::set_detection_window_size()"
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
width: "
<<
width
<<
"
\n\t
height: "
<<
height
<<
"
\n\t
this: "
<<
this
);
window_width
=
width
;
window_height
=
height
;
}
...
...
@@ -118,6 +127,17 @@ namespace dlib
const
double
thresh
)
const
{
// make sure requires clause is not broken
DLIB_ASSERT
(
is_loaded_with_image
()
&&
w
.
size
()
>=
get_num_dimensions
(),
"
\t
void scan_fhog_pyramid::detect()"
<<
"
\n\t
Invalid inputs were given to this function "
<<
"
\n\t
is_loaded_with_image(): "
<<
is_loaded_with_image
()
<<
"
\n\t
w.size(): "
<<
w
.
size
()
<<
"
\n\t
get_num_dimensions(): "
<<
get_num_dimensions
()
<<
"
\n\t
this: "
<<
this
);
fhog_filterbank
temp
=
build_fhog_filterbank
(
w
);
detect
(
temp
,
dets
,
thresh
);
}
...
...
@@ -157,6 +177,15 @@ namespace dlib
const
feature_vector_type
&
weights
)
const
{
// make sure requires clause is not broken
DLIB_ASSERT
(
weights
.
size
()
>=
get_num_dimensions
(),
"
\t
fhog_filterbank scan_fhog_pyramid::build_fhog_filterbank()"
<<
"
\n\t
The number of weights isn't enough to fill out the filterbank. "
<<
"
\n\t
weights.size(): "
<<
weights
.
size
()
<<
"
\n\t
get_num_dimensions(): "
<<
get_num_dimensions
()
<<
"
\n\t
this: "
<<
this
);
fhog_filterbank
temp
;
temp
.
filters
.
resize
(
31
);
temp
.
row_filters
.
resize
(
31
);
...
...
@@ -222,13 +251,15 @@ namespace dlib
void
set_nuclear_norm_regularization_strength
(
double
strength
)
/*!
requires
- strength >= 0
ensures
- #get_nuclear_norm_regularization_strength() == strength
!*/
{
// make sure requires clause is not broken
DLIB_ASSERT
(
strength
>=
0
,
"
\t
void scan_fhog_pyramid::set_nuclear_norm_regularization_strength()"
<<
"
\n\t
You can't have a negative regularization strength."
<<
"
\n\t
strength: "
<<
strength
<<
"
\n\t
this: "
<<
this
);
nuclear_norm_regularization_strength
=
strength
;
}
...
...
@@ -836,6 +867,15 @@ namespace dlib
const
long
cell_draw_size
=
15
)
{
// make sure requires clause is not broken
DLIB_ASSERT
(
cell_draw_size
>
0
&&
detector
.
get_w
().
size
()
>=
detector
.
get_scanner
().
get_num_dimensions
()
,
"
\t
matrix draw_fhog()"
<<
"
\n\t
Invalid arguments were given to this function. "
<<
"
\n\t
cell_draw_size: "
<<
cell_draw_size
<<
"
\n\t
detector.get_w().size(): "
<<
detector
.
get_w
().
size
()
<<
"
\n\t
detector.get_scanner().get_num_dimensions(): "
<<
detector
.
get_scanner
().
get_num_dimensions
()
);
typename
scan_fhog_pyramid
<
Pyramid_type
>::
fhog_filterbank
fb
=
detector
.
get_scanner
().
build_fhog_filterbank
(
detector
.
get_w
());
return
draw_fhog
(
fb
.
get_filters
(),
cell_draw_size
);
}
...
...
@@ -849,6 +889,14 @@ namespace dlib
const
object_detector
<
scan_fhog_pyramid
<
Pyramid_type
>
>&
detector
)
{
// make sure requires clause is not broken
DLIB_ASSERT
(
detector
.
get_w
().
size
()
>=
detector
.
get_scanner
().
get_num_dimensions
()
,
"
\t
unsigned long num_separable_filters()"
<<
"
\n\t
Invalid arguments were given to this function. "
<<
"
\n\t
detector.get_w().size(): "
<<
detector
.
get_w
().
size
()
<<
"
\n\t
detector.get_scanner().get_num_dimensions(): "
<<
detector
.
get_scanner
().
get_num_dimensions
()
);
typename
scan_fhog_pyramid
<
Pyramid_type
>::
fhog_filterbank
fb
=
detector
.
get_scanner
().
build_fhog_filterbank
(
detector
.
get_w
());
return
fb
.
num_separable_filters
();
}
...
...
dlib/image_processing/scan_fhog_pyramid_abstract.h
View file @
2384f6cc
...
...
@@ -416,7 +416,7 @@ namespace dlib
)
const
;
/*!
requires
- w.
get_num_dimensions
() >= get_num_dimensions()
- w.
size
() >= get_num_dimensions()
- is_loaded_with_image() == true
ensures
- performs: detect(build_fhog_filterbank(w), dets, 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