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
77f6c9f2
Commit
77f6c9f2
authored
Nov 24, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made num_separable_filters() work with multi-filter object detectors.
parent
d02e6472
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
scan_fhog_pyramid.h
dlib/image_processing/scan_fhog_pyramid.h
+13
-6
scan_fhog_pyramid_abstract.h
dlib/image_processing/scan_fhog_pyramid_abstract.h
+7
-4
No files found.
dlib/image_processing/scan_fhog_pyramid.h
View file @
77f6c9f2
...
...
@@ -874,8 +874,8 @@ namespace dlib
DLIB_ASSERT
(
weight_index
<
detector
.
num_detectors
(),
"
\t
matrix draw_fhog()"
<<
"
\n\t
Invalid arguments were given to this function. "
<<
"
\n\t
cell_draw_size: "
<<
cell_draw_size
<<
"
\n\t
detector.num_detectors():
"
<<
detector
.
num_detectors
()
<<
"
\n\t
weight_index: "
<<
weight_index
<<
"
\n\t
detector.num_detectors(): "
<<
detector
.
num_detectors
()
);
DLIB_ASSERT
(
cell_draw_size
>
0
&&
detector
.
get_w
(
weight_index
).
size
()
>=
detector
.
get_scanner
().
get_num_dimensions
(),
"
\t
matrix draw_fhog()"
...
...
@@ -896,18 +896,25 @@ namespace dlib
typename
Pyramid_type
>
unsigned
long
num_separable_filters
(
const
object_detector
<
scan_fhog_pyramid
<
Pyramid_type
>
>&
detector
const
object_detector
<
scan_fhog_pyramid
<
Pyramid_type
>
>&
detector
,
const
unsigned
long
weight_index
=
0
)
{
// make sure requires clause is not broken
DLIB_ASSERT
(
detector
.
get_w
().
size
()
>=
detector
.
get_scanner
().
get_num_dimensions
()
,
DLIB_ASSERT
(
weight_index
<
detector
.
num_detectors
(),
"
\t
unsigned long num_separable_filters()"
<<
"
\n\t
Invalid arguments were given to this function. "
<<
"
\n\t
weight_index: "
<<
weight_index
<<
"
\n\t
detector.num_detectors(): "
<<
detector
.
num_detectors
()
);
DLIB_ASSERT
(
detector
.
get_w
(
weight_index
).
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_w(
weight_index).size(): "
<<
detector
.
get_w
(
weight_index
).
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
());
typename
scan_fhog_pyramid
<
Pyramid_type
>::
fhog_filterbank
fb
=
detector
.
get_scanner
().
build_fhog_filterbank
(
detector
.
get_w
(
weight_index
));
return
fb
.
num_separable_filters
();
}
...
...
dlib/image_processing/scan_fhog_pyramid_abstract.h
View file @
77f6c9f2
...
...
@@ -24,7 +24,7 @@ namespace dlib
requires
- cell_draw_size > 0
- weight_index < detector.num_detectors()
- detector.get_w().size() >= detector.get_scanner().get_num_dimensions()
- detector.get_w(
weight_index
).size() >= detector.get_scanner().get_num_dimensions()
(i.e. the detector must have been populated with a HOG filter)
ensures
- Converts the HOG filters in the given detector (specifically, the filters in
...
...
@@ -40,15 +40,18 @@ namespace dlib
typename
Pyramid_type
>
unsigned
long
num_separable_filters
(
const
object_detector
<
scan_fhog_pyramid
<
Pyramid_type
>
>&
detector
const
object_detector
<
scan_fhog_pyramid
<
Pyramid_type
>
>&
detector
,
const
unsigned
long
weight_index
=
0
);
/*!
requires
- detector.get_w().size() >= detector.get_scanner().get_num_dimensions()
- weight_index < detector.num_detectors()
- detector.get_w(weight_index).size() >= detector.get_scanner().get_num_dimensions()
(i.e. the detector must have been populated with a HOG filter)
ensures
- Returns the number of separable filters necessary to represent the HOG
filters in the given detector.
filters in the given detector's weight_index'th filter. This is the filter
defined by detector.get_w(weight_index).
!*/
// ----------------------------------------------------------------------------------------
...
...
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