Commit f10c3389 authored by Davis King's avatar Davis King

Added another draw_fhog() overload.

parent 555b7c8a
...@@ -494,6 +494,33 @@ namespace dlib ...@@ -494,6 +494,33 @@ namespace dlib
return matrix_cast<unsigned char>(upperbound(round(himg*255/thresh),255)); return matrix_cast<unsigned char>(upperbound(round(himg*255/thresh),255));
} }
// ----------------------------------------------------------------------------------------
template <
typename T
>
matrix<unsigned char> draw_fhog (
const std::vector<matrix<T> >& hog,
const long w = 15
)
{
// Just convert the input into the right object and then call the above draw_fhog()
// function on it.
dlib::array<array2d<T> > temp(hog.size());
for (unsigned long i = 0; i < temp.size(); ++i)
{
temp[i].set_size(hog[i].nr(), hog[i].nc());
for (long r = 0; r < hog[i].nr(); ++r)
{
for (long c = 0; c < hog[i].nc(); ++c)
{
temp[i][r][c] = hog[i](r,c);
}
}
}
return draw_fhog(temp,w);
}
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
......
...@@ -175,6 +175,23 @@ namespace dlib ...@@ -175,6 +175,23 @@ namespace dlib
pixels wide and tall. pixels wide and tall.
!*/ !*/
// ----------------------------------------------------------------------------------------
template <
typename T
>
matrix<unsigned char> draw_fhog (
const std::vector<matrix<T> >& hog,
const long cell_draw_size = 15
);
/*!
requires
- cell_draw_size > 0
ensures
- This function just converts the given hog object into an array<array2d<T>>
and passes it to the above draw_fhog() routine and returns the results.
!*/
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
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