Commit c8aa81c2 authored by Davis King's avatar Davis King

Set a default value for the cell size on image_to_fhog() and fhog_to_image().

parent 6d7f25bf
...@@ -395,24 +395,24 @@ namespace dlib ...@@ -395,24 +395,24 @@ namespace dlib
inline point image_to_fhog ( inline point image_to_fhog (
point p, point p,
int sbin int cell_size = 8
) )
{ {
// There is a one pixel border around the imag. // There is a one pixel border around the imag.
p -= point(1,1); p -= point(1,1);
// There is also a 1 "cell" border around the HOG image formation. // There is also a 1 "cell" border around the HOG image formation.
return p/sbin - point(1,1); return p/cell_size - point(1,1);
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
inline point fhog_to_image ( inline point fhog_to_image (
point p, point p,
int sbin int cell_size = 8
) )
{ {
// Convert to image space and then set to the center of the cell. // Convert to image space and then set to the center of the cell.
return (p+point(1,1))*sbin + point(1,1) + point(sbin/2,sbin/2); return (p+point(1,1))*cell_size + point(1,1) + point(cell_size/2,cell_size/2);
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -83,7 +83,7 @@ namespace dlib ...@@ -83,7 +83,7 @@ namespace dlib
inline point image_to_fhog ( inline point image_to_fhog (
point p, point p,
int cell_size int cell_size = 8
); );
/*! /*!
requires requires
...@@ -104,7 +104,7 @@ namespace dlib ...@@ -104,7 +104,7 @@ namespace dlib
inline point fhog_to_image ( inline point fhog_to_image (
point p, point p,
int cell_size int cell_size = 8
); );
/*! /*!
requires requires
......
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