Commit 29eb15d7 authored by Davis King's avatar Davis King

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

parent 8ab309a8
...@@ -434,26 +434,6 @@ namespace dlib ...@@ -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 < template <
typename in_image_type, typename in_image_type,
typename diff_type typename diff_type
...@@ -604,6 +584,26 @@ namespace dlib ...@@ -604,6 +584,26 @@ namespace dlib
} }
} // end namespace impl } // 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 < template <
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment