mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Added overloads of fhog_to_image() and image_to_fhog() that work on rectangles.
This commit is contained in:
parent
075ed63861
commit
de361671b2
@ -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 <
|
||||
|
Loading…
Reference in New Issue
Block a user