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
a1a0e782
Commit
a1a0e782
authored
Apr 02, 2013
by
Davis King
Browse files
Upgraded the object_detector so that you can use the adjust_threshold
argument for all versions of the operator() method.
parent
6133b614
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
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
+10
-4
No files found.
dlib/image_processing/object_detector.h
View file @
a1a0e782
...
...
@@ -52,7 +52,8 @@ namespace dlib
typename
image_type
>
std
::
vector
<
rectangle
>
operator
()
(
const
image_type
&
img
const
image_type
&
img
,
double
adjust_threshold
=
0
);
template
<
...
...
@@ -250,7 +251,8 @@ namespace dlib
>
std
::
vector
<
rectangle
>
object_detector
<
image_scanner_type
>::
operator
()
(
const
image_type
&
img
const
image_type
&
img
,
double
adjust_threshold
)
{
std
::
vector
<
rectangle
>
final_dets
;
...
...
@@ -260,7 +262,7 @@ namespace dlib
const
double
thresh
=
w
(
scanner
.
get_num_dimensions
());
scanner
.
load
(
img
);
scanner
.
detect
(
w
,
dets
,
thresh
);
scanner
.
detect
(
w
,
dets
,
thresh
+
adjust_threshold
);
for
(
unsigned
long
i
=
0
;
i
<
dets
.
size
();
++
i
)
{
...
...
dlib/image_processing/object_detector_abstract.h
View file @
a1a0e782
...
...
@@ -116,7 +116,8 @@ namespace dlib
typename
image_type
>
std
::
vector
<
rectangle
>
operator
()
(
const
image_type
&
img
const
image_type
&
img
,
const
adjust_threshold
=
0
);
/*!
requires
...
...
@@ -131,6 +132,11 @@ namespace dlib
#get_scanner().get_feature_vector() to obtain the feature vectors or
#get_scanner().get_full_object_detection() to get the
full_object_detections for 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 value makes it easier. This means that, for
example, you can obtain the maximum possible number of detections by
setting adjust_threshold equal to negative infinity.
!*/
template
<
...
...
@@ -161,11 +167,11 @@ namespace dlib
full_object_detections for 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
on
e makes it easier. Moreover, the following
harder while a negative
valu
e makes it easier. Moreover, the following
will be true for all valid i:
- #dets[i].first >= adjust_threshold
This means that, for example, you can obtain
all possible detections as
o
utput
s by setting adjust_threshold equal to negative infinity.
This means that, for example, you can obtain
the maximum possible number
o
f detection
s by setting adjust_threshold equal to negative infinity.
!*/
template
<
...
...
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