TLIB documentation
 

tlBackground Class Reference

List of all members.


Detailed Description

Background definition and learning class.

The tlBackground class makes it possible to define a background image of any format, and optionally have it learn the statistical (gaussian) distribution of each pixel by providing it with additionnal images over time.

Background definition parameters

Vmin is the minimal allowed variance for each pixel.
Vmax is the maximal allowed variance for each pixel.
alpha is the gaussian mean averaging factor: mean = alpha*mean+(1-alpha)*new_value
K is the variance scaling factor: the background boundary is { mean-K*variance ; mean+K*variance }
Koffset is the foreground filter offset for STEREO format only : the foreground is defined as { [0 ; Koffset+mean-K*variance] && [ Koffset+mean+K*variance ; TL_MAX_VALUE] }.

Public Member Functions

 tlBackground ()
 tlBackground (float Vmin, float Vmax, float alpha, float K, float Koffset)
virtual ~tlBackground ()
int setParam (float Vmin, float Vmax, float alpha, float K, float Koffset)
int init (tlImage *image, int adapt=0, int learn=0)
int update (tlImage *image)
int update (tlImage *image, tlRect *rect)
int get (tlImage *dest)
int getVariance (tlImage *dest)
int filter (tlImage *image)
int filter (tlImage *image, tlRect *rect)

Constructor & Destructor Documentation

tlBackground::tlBackground (  ) 

Constructor.

Note:
See error management for details.

tlBackground::tlBackground ( float  Vmin,
float  Vmax,
float  alpha,
float  K,
float  Koffset 
)

Constructor. See background learning parameters for details.

Note:
See error management for details.

tlBackground::~tlBackground (  )  [virtual]

Destructor.

Note:
See error management for details.


Member Function Documentation

int tlBackground::setParam ( float  Vmin,
float  Vmax,
float  alpha,
float  K,
float  Koffset 
)

Set the image learning parameters. See background learning parameters for details.

Returns:
0 on success, -1 otherwise. See error management for details.

int tlBackground::init ( tlImage image,
int  learn = 0,
int  adapt = 0 
)

Init or reset background computing

Parameters:
image initial image
learn 0 for static background definition, 1 for dynamic background learning
adapt 0 if the background is static, 1 for adaptive background
Returns:
0 on success, -1 otherwise. See error management for details.

int tlBackground::update ( tlImage image  ) 

Learn from a new image (next learning iteration).

Parameters:
image new disparity image
Returns:
0 on success, -1 otherwise. See error management for details.

int tlBackground::update ( tlImage image,
tlRect rect 
)

Learn part of the image from a new image (next learning iteration).

Parameters:
image new disparity image
rect the area of the image to consider
Returns:
0 on success, -1 otherwise. See error management for details.

int tlBackground::get ( tlImage dest  ) 

Get an image of the current learned background.

Parameters:
dest [out] valid image pointer that will contain the background mask.
Returns:
0 on success, -1 otherwise. See error management for details.

int tlBackground::getVariance ( tlImage dest  ) 

Get an image of the current variance distribution.

Parameters:
dest [out] valid image pointer that will contain the variance image.
Returns:
0 on success, -1 otherwise. See error management for details.

int tlBackground::filter ( tlImage image  ) 

Filter the background out of a given image.

Parameters:
image the image to filter.
Returns:
0 on success, -1 otherwise. See error management for details.

int tlBackground::filter ( tlImage image,
tlRect rect 
)

Filter the background out of a portion of a given image.

Parameters:
image the image to filter.
rect the portion of the image to filter.
Returns:
0 on success, -1 otherwise. See error management for details.


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

TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.