Commit de361671 authored by Davis King's avatar Davis King

Added overloads of fhog_to_image() and image_to_fhog() that work on rectangles.

parent 075ed638
......@@ -415,6 +415,17 @@ namespace dlib
return p/cell_size - point(1,1);
}
// ----------------------------------------------------------------------------------------
inline rectangle image_to_fhog (
const rectangle& rect,
int cell_size = 8
)
{
return rectangle(image_to_fhog(rect.tl_corner(),cell_size),
image_to_fhog(rect.br_corner(),cell_size));
}
// ----------------------------------------------------------------------------------------
inline point fhog_to_image (
......@@ -426,6 +437,17 @@ namespace dlib
return (p+point(1,1))*cell_size + point(1,1) + point(cell_size/2,cell_size/2);
}
// ----------------------------------------------------------------------------------------
inline rectangle fhog_to_image (
const rectangle& rect,
int cell_size = 8
)
{
return rectangle(fhog_to_image(rect.tl_corner(),cell_size),
fhog_to_image(rect.br_corner(),cell_size));
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
......
......@@ -100,6 +100,20 @@ namespace dlib
input image.
!*/
// ----------------------------------------------------------------------------------------
inline rectangle image_to_fhog (
const rectangle& rect,
int cell_size = 8
);
/*!
requires
- cell_size > 0
ensures
- maps a rectangle from image space to fhog space. In particular this function returns:
rectangle(image_to_fhog(rect.tl_corner(),cell_size), image_to_fhog(rect.br_corner(),cell_size))
!*/
// ----------------------------------------------------------------------------------------
inline point fhog_to_image (
......@@ -118,6 +132,20 @@ namespace dlib
cell_size should be set to the value used by the call to extract_fhog_features().
!*/
// ----------------------------------------------------------------------------------------
inline rectangle fhog_to_image (
const rectangle& rect,
int cell_size = 8
);
/*!
requires
- cell_size > 0
ensures
- maps a rectangle from fhog space to image space. In particular this function returns:
rectangle(fhog_to_image(rect.tl_corner(),cell_size), fhog_to_image(rect.br_corner(),cell_size))
!*/
// ----------------------------------------------------------------------------------------
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