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
bfa7d1d7
Commit
bfa7d1d7
authored
Dec 26, 2011
by
Davis King
Browse files
Added the setup_grid_detection_templates() routine.
parent
b4734976
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
dlib/image_processing/scan_image_pyramid_tools.h
dlib/image_processing/scan_image_pyramid_tools.h
+18
-0
dlib/image_processing/scan_image_pyramid_tools_abstract.h
dlib/image_processing/scan_image_pyramid_tools_abstract.h
+27
-0
No files found.
dlib/image_processing/scan_image_pyramid_tools.h
View file @
bfa7d1d7
...
@@ -203,6 +203,24 @@ namespace dlib
...
@@ -203,6 +203,24 @@ namespace dlib
return
determine_object_boxes
(
scanner
,
temp
,
min_match_score
);
return
determine_object_boxes
(
scanner
,
temp
,
min_match_score
);
}
}
// ----------------------------------------------------------------------------------------
template
<
typename
image_scanner_type
>
void
setup_grid_detection_templates
(
image_scanner_type
&
scanner
,
const
std
::
vector
<
std
::
vector
<
rectangle
>
>&
rects
,
unsigned
int
cells_x
,
unsigned
int
cells_y
,
double
min_match_score
=
0.75
)
{
const
std
::
vector
<
rectangle
>&
object_boxes
=
determine_object_boxes
(
scanner
,
rects
,
min_match_score
);
for
(
unsigned
long
i
=
0
;
i
<
object_boxes
.
size
();
++
i
)
{
scanner
.
add_detection_template
(
object_boxes
[
i
],
create_grid_detection_template
(
object_boxes
[
i
],
cells_x
,
cells_y
));
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
}
}
...
...
dlib/image_processing/scan_image_pyramid_tools_abstract.h
View file @
bfa7d1d7
...
@@ -129,6 +129,33 @@ namespace dlib
...
@@ -129,6 +129,33 @@ namespace dlib
and returns the results.
and returns the results.
!*/
!*/
// ----------------------------------------------------------------------------------------
template
<
typename
image_scanner_type
>
void
setup_grid_detection_templates
(
image_scanner_type
&
scanner
,
const
std
::
vector
<
std
::
vector
<
rectangle
>
>&
rects
,
unsigned
int
cells_x
,
unsigned
int
cells_y
,
double
min_match_score
=
0.75
);
/*!
requires
- cells_x > 0
- cells_y > 0
- 0 < min_match_score <= 1
- image_scanner_type == an implementation of the scan_image_pyramid
object defined in dlib/image_processing/scan_image_pyramid_tools_abstract.h
ensures
- uses determine_object_boxes(scanner,rects,min_match_score) to obtain a set of
object boxes and then adds them to the given scanner object as detection templates.
Also uses create_grid_detection_template(object_box, cells_x, cells_y) to create
each feature extraction region. Therefore, the detection templates will extract
features from a regular grid inside each object box.
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
}
}
...
...
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