moved remove_duplicates() from dlib::impl to dlib namespace.

This commit is contained in:
Davis King 2013-03-17 14:43:02 -04:00
parent 8ab309a894
commit 29eb15d743

View File

@ -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 <