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
4d8a070a
Commit
4d8a070a
authored
Aug 26, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added another overloaded operator() to the object_detector so that it is
easy to get full_object_detections out of it.
parent
a6b44e0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
object_detector.h
dlib/image_processing/object_detector.h
+40
-0
object_detector_abstract.h
dlib/image_processing/object_detector_abstract.h
+21
-0
No files found.
dlib/image_processing/object_detector.h
View file @
4d8a070a
...
...
@@ -7,6 +7,7 @@
#include "../geometry.h"
#include <vector>
#include "box_overlap_testing.h"
#include "full_object_detection.h"
namespace
dlib
{
...
...
@@ -64,6 +65,15 @@ namespace dlib
double
adjust_threshold
=
0
);
template
<
typename
image_type
>
void
operator
()
(
const
image_type
&
img
,
std
::
vector
<
std
::
pair
<
double
,
full_object_detection
>
>&
final_dets
,
double
adjust_threshold
=
0
);
template
<
typename
T
,
typename
U
>
friend
void
serialize
(
const
object_detector
<
T
,
U
>&
item
,
...
...
@@ -289,6 +299,36 @@ namespace dlib
}
}
// ----------------------------------------------------------------------------------------
template
<
typename
image_scanner_type
,
typename
overlap_tester_type
>
template
<
typename
image_type
>
void
object_detector
<
image_scanner_type
,
overlap_tester_type
>::
operator
()
(
const
image_type
&
img
,
std
::
vector
<
std
::
pair
<
double
,
full_object_detection
>
>&
final_dets
,
double
adjust_threshold
)
{
std
::
vector
<
std
::
pair
<
double
,
rectangle
>
>
temp_dets
;
(
*
this
)(
img
,
temp_dets
,
adjust_threshold
);
final_dets
.
clear
();
final_dets
.
reserve
(
temp_dets
.
size
());
// convert all the rectangle detections into full_object_detections.
for
(
unsigned
long
i
=
0
;
i
<
temp_dets
.
size
();
++
i
)
{
final_dets
.
push_back
(
std
::
make_pair
(
temp_dets
[
i
].
first
,
scanner
.
get_full_object_detection
(
temp_dets
[
i
].
second
,
w
)));
}
}
// ----------------------------------------------------------------------------------------
template
<
...
...
dlib/image_processing/object_detector_abstract.h
View file @
4d8a070a
...
...
@@ -6,6 +6,7 @@
#include "../geometry.h"
#include <vector>
#include "box_overlap_testing_abstract.h"
#include "full_object_detection_abstract.h"
namespace
dlib
{
...
...
@@ -167,6 +168,26 @@ namespace dlib
objects harder while a negative one makes it easier.
!*/
template
<
typename
image_type
>
void
operator
()
(
const
image_type
&
img
,
std
::
vector
<
std
::
pair
<
double
,
full_object_detection
>
>&
final_dets
,
double
adjust_threshold
=
0
);
/*!
requires
- img == an object which can be accepted by image_scanner_type::load()
ensures
- This function is identical to the above operator() routine, except that
it outputs full_object_detections instead of rectangles. This means that
the output includes part locations. In particular, calling this function
is the same as calling the above operator() routine and then using
get_scanner().get_full_object_detection() to resolve all the rectangles
into full_object_detections. Therefore, this version of operator() is
simply a convenience function for performing this set of operations.
!*/
};
// ----------------------------------------------------------------------------------------
...
...
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