libeblearn
|
#include <ebl_preprocessing.h>
Public Member Functions | |
resize_module (double hratio, double wratio, uint mode=BILINEAR_RESIZE, uint hzpad=0, uint wzpad=0, bool preserve_ratio=false) | |
resize_module (intg height, intg width, uint mode=MEAN_RESIZE, uint hzpad=0, uint wzpad=0, bool preserve_ratio=false) | |
resize_module (uint mode=MEAN_RESIZE, uint hzpad=0, uint wzpad=0, bool preserve_ratio=false) | |
virtual | ~resize_module () |
destructor | |
void | set_dimensions (intg height, intg width) |
sets the desired output dimensions. | |
void | set_input_region (const rect< int > &inr) |
void | set_output_region (const rect< int > &outr) |
void | set_jitter (int h, int w, float s, float r) |
Shift output by h and w pixels, multiply scale by s and rotate by r. | |
void | set_zpads (intg hpad, intg wpad) |
Set zero padding on each side for each dimension. | |
virtual void | fprop (Tstate &in, Tstate &out) |
forward propagation from in to out | |
virtual void | bprop (Tstate &in, Tstate &out) |
bprop from in to out | |
virtual void | bbprop (Tstate &in, Tstate &out) |
bbprop from in to out | |
rect< int > | get_original_bbox () |
virtual resize_module< T, Tstate > * | copy () |
Returns a deep copy of this module. | |
virtual std::string | describe () |
Returns a string describing this module and its parameters. |
Resize the input to the desired output (not preserving aspect ratio by default, see 'preserve_ratio' parameter).
ebl::resize_module< T, Tstate >::resize_module | ( | double | hratio, |
double | wratio, | ||
uint | mode = BILINEAR_RESIZE , |
||
uint | hzpad = 0 , |
||
uint | wzpad = 0 , |
||
bool | preserve_ratio = false |
||
) |
This constructor specifies resizing ratio for each dimension instead of fixed target sizes. The default resizing method is bilinear, as as other methods do not currently implement ratio inputs.
height | target height for resizing. |
width | target width for resizing. |
mode | The type of resizing (MEAN_RESIZE, BILINEAR_RESIZE, GAUSSIAN_RESIZE). |
hzpad | Optional vertical zero-padding is added on each size and taken into account to reach the desired target size. |
wzpad | Optional horizontal zero-padding is added on each size and taken into account to reach the desired target size. |
preserve_ratio | If true, fit the image into target size while keeping aspect ratio, eventual empty areas are filled with zeros. |
ebl::resize_module< T, Tstate >::resize_module | ( | intg | height, |
intg | width, | ||
uint | mode = MEAN_RESIZE , |
||
uint | hzpad = 0 , |
||
uint | wzpad = 0 , |
||
bool | preserve_ratio = false |
||
) |
Constructor.
height | target height for resizing. |
width | target width for resizing. |
mode | The type of resizing (MEAN_RESIZE, BILINEAR_RESIZE, GAUSSIAN_RESIZE). |
hzpad | Optional vertical zero-padding is added on each size and taken into account to reach the desired target size. |
wzpad | Optional horizontal zero-padding is added on each size and taken into account to reach the desired target size. |
preserve_ratio | If true, fit the image into target size while keeping aspect ratio, eventual empty areas are filled with zeros. |
ebl::resize_module< T, Tstate >::resize_module | ( | uint | mode = MEAN_RESIZE , |
uint | hzpad = 0 , |
||
uint | wzpad = 0 , |
||
bool | preserve_ratio = false |
||
) |
Constructor without target dimensions. set_dimensions should be called later.
mode | The type of resizing (MEAN_RESIZE, BILINEAR_RESIZE, GAUSSIAN_RESIZE). |
hzpad | Optional vertical zero-padding is added on each size and taken into account to reach the desired target size. |
wzpad | Optional horizontal zero-padding is added on each size and taken into account to reach the desired target size. |
preserve_ratio | If true, fit the image into target size while keeping aspect ratio, potential empty areas are filled with zeros. |
rect< int > ebl::resize_module< T, Tstate >::get_original_bbox | ( | ) |
return the bounding box of the original input in the output coordinate system.
void ebl::resize_module< T, Tstate >::set_input_region | ( | const rect< int > & | inr | ) |
set the region to use in the input image. by default, the input region is the entire image.
void ebl::resize_module< T, Tstate >::set_output_region | ( | const rect< int > & | outr | ) |
set the region to use in the output image. by default, the output region is the entire size defined by set_dimensions().