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

This commit is contained in:
Davis King 2013-10-18 22:49:58 -04:00
parent 075ed63861
commit de361671b2
2 changed files with 50 additions and 0 deletions

View File

@ -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));
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------

View File

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