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
4891faec
Commit
4891faec
authored
Jan 08, 2012
by
Davis King
Browse files
Made the object_detector's interface a little more flexible.
parent
0433da57
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
dlib/image_processing/object_detector.h
dlib/image_processing/object_detector.h
+5
-3
dlib/image_processing/object_detector_abstract.h
dlib/image_processing/object_detector_abstract.h
+5
-1
No files found.
dlib/image_processing/object_detector.h
View file @
4891faec
...
@@ -59,7 +59,8 @@ namespace dlib
...
@@ -59,7 +59,8 @@ namespace dlib
>
>
void
operator
()
(
void
operator
()
(
const
image_type
&
img
,
const
image_type
&
img
,
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>&
final_dets
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>&
final_dets
,
double
adjust_threshold
);
);
template
<
typename
T
,
typename
U
>
template
<
typename
T
,
typename
U
>
...
@@ -263,14 +264,15 @@ namespace dlib
...
@@ -263,14 +264,15 @@ namespace dlib
void
object_detector
<
image_scanner_type
,
overlap_tester_type
>::
void
object_detector
<
image_scanner_type
,
overlap_tester_type
>::
operator
()
(
operator
()
(
const
image_type
&
img
,
const
image_type
&
img
,
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>&
final_dets
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>&
final_dets
,
double
adjust_threshold
)
)
{
{
final_dets
.
clear
();
final_dets
.
clear
();
if
(
w
.
size
()
!=
0
)
if
(
w
.
size
()
!=
0
)
{
{
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>
dets
;
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>
dets
;
const
double
thresh
=
w
(
scanner
.
get_num_dimensions
());
const
double
thresh
=
w
(
scanner
.
get_num_dimensions
())
+
adjust_threshold
;
scanner
.
load
(
img
);
scanner
.
load
(
img
);
scanner
.
detect
(
w
,
dets
,
thresh
);
scanner
.
detect
(
w
,
dets
,
thresh
);
...
...
dlib/image_processing/object_detector_abstract.h
View file @
4891faec
...
@@ -131,7 +131,8 @@ namespace dlib
...
@@ -131,7 +131,8 @@ namespace dlib
>
>
void
operator
()
(
void
operator
()
(
const
image_type
&
img
,
const
image_type
&
img
,
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>&
dets
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>&
dets
,
double
adjust_threshold
=
0
);
);
/*!
/*!
requires
requires
...
@@ -150,6 +151,9 @@ namespace dlib
...
@@ -150,6 +151,9 @@ namespace dlib
- #get_scanner() will have been loaded with img. Therefore, you can call
- #get_scanner() will have been loaded with img. Therefore, you can call
#get_scanner().get_feature_vector() to obtain the feature vectors for
#get_scanner().get_feature_vector() to obtain the feature vectors for
the resulting object detection boxes.
the resulting object detection boxes.
- The detection threshold is adjusted by having adjust_threshold added
to it. Therefore, an adjust_threshold value > 0 makes detecting
objects harder while a negative one makes it easier.
!*/
!*/
};
};
...
...
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