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
977f6b11
Commit
977f6b11
authored
May 24, 2014
by
Davis King
Browse files
Improved non-max-suppression for detectors with multiple sub-detectors packed
into them.
parent
c423283c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
dlib/image_processing/object_detector.h
dlib/image_processing/object_detector.h
+10
-1
No files found.
dlib/image_processing/object_detector.h
View file @
977f6b11
...
...
@@ -179,6 +179,14 @@ namespace dlib
private:
static
bool
compare_pair_rect
(
const
std
::
pair
<
double
,
rectangle
>&
a
,
const
std
::
pair
<
double
,
rectangle
>&
b
)
{
return
a
.
first
<
b
.
first
;
}
bool
overlaps_any_box
(
const
std
::
vector
<
rect_detection
>&
rects
,
const
dlib
::
rectangle
&
rect
...
...
@@ -439,6 +447,8 @@ namespace dlib
// Do non-max suppression
final_dets
.
clear
();
if
(
w
.
size
()
>
1
)
std
::
sort
(
dets
.
rbegin
(),
dets
.
rend
(),
compare_pair_rect
);
for
(
unsigned
long
i
=
0
;
i
<
dets_accum
.
size
();
++
i
)
{
if
(
overlaps_any_box
(
final_dets
,
dets_accum
[
i
].
rect
))
...
...
@@ -446,7 +456,6 @@ namespace dlib
final_dets
.
push_back
(
dets_accum
[
i
]);
}
std
::
sort
(
final_dets
.
rbegin
(),
final_dets
.
rend
());
}
// ----------------------------------------------------------------------------------------
...
...
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