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
29eb15d7
Commit
29eb15d7
authored
Mar 17, 2013
by
Davis King
Browse files
moved remove_duplicates() from dlib::impl to dlib namespace.
parent
8ab309a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
dlib/image_transforms/segment_image.h
dlib/image_transforms/segment_image.h
+20
-20
No files found.
dlib/image_transforms/segment_image.h
View file @
29eb15d7
...
...
@@ -434,26 +434,6 @@ namespace dlib
}
};
template
<
typename
alloc
>
void
remove_duplicates
(
std
::
vector
<
rectangle
,
alloc
>&
rects
)
{
std
::
sort
(
rects
.
begin
(),
rects
.
end
(),
std
::
less
<
rectangle
>
());
unsigned
long
num_unique
=
1
;
for
(
unsigned
long
i
=
1
;
i
<
rects
.
size
();
++
i
)
{
if
(
rects
[
i
]
!=
rects
[
i
-
1
])
{
rects
[
num_unique
++
]
=
rects
[
i
];
}
}
if
(
rects
.
size
()
!=
0
)
rects
.
resize
(
num_unique
);
}
// ------------------------------------------------------------------------------------
template
<
typename
in_image_type
,
typename
diff_type
...
...
@@ -604,6 +584,26 @@ namespace dlib
}
}
// end namespace impl
// ----------------------------------------------------------------------------------------
template
<
typename
alloc
>
void
remove_duplicates
(
std
::
vector
<
rectangle
,
alloc
>&
rects
)
{
std
::
sort
(
rects
.
begin
(),
rects
.
end
(),
std
::
less
<
rectangle
>
());
unsigned
long
num_unique
=
1
;
for
(
unsigned
long
i
=
1
;
i
<
rects
.
size
();
++
i
)
{
if
(
rects
[
i
]
!=
rects
[
i
-
1
])
{
rects
[
num_unique
++
]
=
rects
[
i
];
}
}
if
(
rects
.
size
()
!=
0
)
rects
.
resize
(
num_unique
);
}
// ----------------------------------------------------------------------------------------
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