mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
moved remove_duplicates() from dlib::impl to dlib namespace.
This commit is contained in:
parent
8ab309a894
commit
29eb15d743
@ -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 <
|
||||
|
Loading…
Reference in New Issue
Block a user