libeblearn
ebl::resize_module< T, Tstate > Class Template Reference

#include <ebl_preprocessing.h>

Inheritance diagram for ebl::resize_module< T, Tstate >:
ebl::module_1_1< T, Tstate > ebl::module

List of all members.

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.

Detailed Description

template<typename T, class Tstate = bbstate_idx<T>>
class ebl::resize_module< T, Tstate >

Resize the input to the desired output (not preserving aspect ratio by default, see 'preserve_ratio' parameter).


Constructor & Destructor Documentation

template<typename T , class Tstate >
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.

Parameters:
heighttarget height for resizing.
widthtarget width for resizing.
modeThe type of resizing (MEAN_RESIZE, BILINEAR_RESIZE, GAUSSIAN_RESIZE).
hzpadOptional vertical zero-padding is added on each size and taken into account to reach the desired target size.
wzpadOptional horizontal zero-padding is added on each size and taken into account to reach the desired target size.
preserve_ratioIf true, fit the image into target size while keeping aspect ratio, eventual empty areas are filled with zeros.
template<typename T , class Tstate >
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.

Parameters:
heighttarget height for resizing.
widthtarget width for resizing.
modeThe type of resizing (MEAN_RESIZE, BILINEAR_RESIZE, GAUSSIAN_RESIZE).
hzpadOptional vertical zero-padding is added on each size and taken into account to reach the desired target size.
wzpadOptional horizontal zero-padding is added on each size and taken into account to reach the desired target size.
preserve_ratioIf true, fit the image into target size while keeping aspect ratio, eventual empty areas are filled with zeros.
template<typename T , class Tstate >
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.

Parameters:
modeThe type of resizing (MEAN_RESIZE, BILINEAR_RESIZE, GAUSSIAN_RESIZE).
hzpadOptional vertical zero-padding is added on each size and taken into account to reach the desired target size.
wzpadOptional horizontal zero-padding is added on each size and taken into account to reach the desired target size.
preserve_ratioIf true, fit the image into target size while keeping aspect ratio, potential empty areas are filled with zeros.

Member Function Documentation

template<typename T , class Tstate >
rect< int > ebl::resize_module< T, Tstate >::get_original_bbox ( )

return the bounding box of the original input in the output coordinate system.

template<typename T , class Tstate >
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.

template<typename T , class Tstate >
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().


The documentation for this class was generated from the following files: