LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::linearRegressionTracking Class Reference

With this tracking algorithm it is possible to track the movement of an object together with scaling and rotation in the image plane. More...

#include <ltiLinearRegressionTracking.h>

Inheritance diagram for lti::linearRegressionTracking:
Inheritance graph
[legend]
Collaboration diagram for lti::linearRegressionTracking:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class linearRegressionTracking More...

Public Member Functions

 linearRegressionTracking ()
 linearRegressionTracking (const parameters &par)
 linearRegressionTracking (const linearRegressionTracking &other)
virtual ~linearRegressionTracking ()
virtual const char * getTypeName () const
bool learnDisplacement (channel &referenceImage, rectangle imageSection)
bool learnDisplacementRGB (image &referenceImage, rectangle imageSection)
void getDisplacement (channel &theImage, int xpos, int ypos, double &dx, double &dy) const
void getDisplacementRGB (image &theImage, int xpos, int ypos, double &dx, double &dy) const
bool learnTracking (channel &referenceImage, rectangle imageSection)
bool learnTrackingRGB (image &referenceImage, rectangle imageSection)
void getDispRotScale (channel &theImage, double xpos, double ypos, double alpha, double scale, double &dx, double &dy, double &dAlpha, double &dScale) const
void getDispRotScaleRGB (image &theImage, double xpos, double ypos, double alpha, double scale, double &dx, double &dy, double &dAlpha, double &dScale) const
linearRegressionTrackingcopy (const linearRegressionTracking &other)
linearRegressionTrackingoperator= (const linearRegressionTracking &other)
virtual functorclone () const
const parametersgetParameters () const
virtual bool read (ioHandler &handler, const bool complete=true)
virtual bool write (ioHandler &handler, const bool complete=true) const
void getReferenceSection (vector< double > &referenceSection, int &w, int &h) const
void setReferenceSection (vector< double > &referenceSection, int w, int h)

Protected Attributes

vector< double > referenceValues
int width

Detailed Description

With this tracking algorithm it is possible to track the movement of an object together with scaling and rotation in the image plane.

It uses the difference between the reference image of the object and the image values at the current position to estimate the correction of the geometrical parameters. This relation is calculated in a training phase using linear regression. To achieve stable tracking results, the image values in the background should be similar to those in the training image. It is also required that the movement of the object between subsequent frames is not too big, there should be still an overlap of the object areas at the two positions.


Constructor & Destructor Documentation

lti::linearRegressionTracking::linearRegressionTracking (  ) 

default constructor

lti::linearRegressionTracking::linearRegressionTracking ( const parameters par  ) 

Construct a functor using the given parameters.

lti::linearRegressionTracking::linearRegressionTracking ( const linearRegressionTracking other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::linearRegressionTracking::~linearRegressionTracking (  )  [virtual]

destructor


Member Function Documentation

virtual functor* lti::linearRegressionTracking::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::linearRegression< double >.

linearRegressionTracking& lti::linearRegressionTracking::copy ( const linearRegressionTracking other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

void lti::linearRegressionTracking::getDisplacement ( channel theImage,
int  xpos,
int  ypos,
double &  dx,
double &  dy 
) const

estimates the object displacement from the difference of current and reference channel values

Parameters:
theImage current frame channel
xpos current x-position of left upper edge of object
ypos current y-position of left upper edge of object
dx estimated displacement in x-direction
dy estimated displacement in y-direction
void lti::linearRegressionTracking::getDisplacementRGB ( image theImage,
int  xpos,
int  ypos,
double &  dx,
double &  dy 
) const

estimates the object displacement from the difference of current and reference RGB values

Parameters:
theImage current frame channel
xpos current x-position of left upper edge of object
ypos current y-position of left upper edge of object
dx estimated displacement in x-direction
dy estimated displacement in y-direction
void lti::linearRegressionTracking::getDispRotScale ( channel theImage,
double  xpos,
double  ypos,
double  alpha,
double  scale,
double &  dx,
double &  dy,
double &  dAlpha,
double &  dScale 
) const

estimates the object displacement, scaling and rotation from the difference of current and reference channel values.

Use more than one iteration per frame for best results.

Parameters:
theImage current frame channel
xpos current x-position of object center
ypos current y-position of object center
alpha current object angle
scale current object scale
dx estimated displacement in x-direction
dy estimated displacement in y-direction
dAlpha estimated angle difference
dScale estimated scale difference
void lti::linearRegressionTracking::getDispRotScaleRGB ( image theImage,
double  xpos,
double  ypos,
double  alpha,
double  scale,
double &  dx,
double &  dy,
double &  dAlpha,
double &  dScale 
) const

estimates the object displacement, scaling and rotation from the difference of current and reference RGB values.

Use more than one iteration per frame for best results.

Parameters:
theImage current frame image
xpos current x-position of object center
ypos current y-position of object center
alpha current object angle
scale current object scale
dx estimated displacement in x-direction
dy estimated displacement in y-direction
dAlpha estimated angle difference
dScale estimated scale difference
const parameters& lti::linearRegressionTracking::getParameters (  )  const

returns used parameters

Reimplemented from lti::linearRegression< double >.

void lti::linearRegressionTracking::getReferenceSection ( vector< double > &  referenceSection,
int &  w,
int &  h 
) const

gets the values of the reference image section used for calculating the error vector

Parameters:
referenceSection contains either the grey-scale or RGB-values in a vector
w width of image section
h height of image section
virtual const char* lti::linearRegressionTracking::getTypeName (  )  const [virtual]

returns the name of this type ("linearRegressionTracking")

Reimplemented from lti::linearRegression< double >.

bool lti::linearRegressionTracking::learnDisplacement ( channel referenceImage,
rectangle  imageSection 
)

training of x- and y-movement in the image plane using channel values

Parameters:
referenceImage reference channel to be used for training
imageSection rectangle that surrounds the object in the given image
bool lti::linearRegressionTracking::learnDisplacementRGB ( image referenceImage,
rectangle  imageSection 
)

training of x- and y-movement in the image plane using RGB values

Parameters:
referenceImage reference image to be used for training
imageSection rectangle that surrounds the object in the given image
bool lti::linearRegressionTracking::learnTracking ( channel referenceImage,
rectangle  imageSection 
)

training of x- and y-movement as well as scaling and rotation in the image plane using channel values

Parameters:
referenceImage reference channel to be used for training
imageSection rectangle that surrounds the object in the given image
bool lti::linearRegressionTracking::learnTrackingRGB ( image referenceImage,
rectangle  imageSection 
)

training of x- and y-movement as well as scaling and rotation in the image plane using RGB values

Parameters:
referenceImage reference channel to be used for training
imageSection rectangle that surrounds the object in the given image
linearRegressionTracking& lti::linearRegressionTracking::operator= ( const linearRegressionTracking other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

virtual bool lti::linearRegressionTracking::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

reads this functor from the given handler.

Reimplemented from lti::linearRegression< double >.

void lti::linearRegressionTracking::setReferenceSection ( vector< double > &  referenceSection,
int  w,
int  h 
)

sets the values of the reference image section used for calculating the error vector

Parameters:
referenceSection contains either the grey-scale or RGB-values in a vector
w width of image section
h height of image section
virtual bool lti::linearRegressionTracking::write ( ioHandler handler,
const bool  complete = true 
) const [virtual]

writes this functor to the given handler.

Reimplemented from lti::linearRegression< double >.


Member Data Documentation

reference image values (grey level or RGB-values subsequently) of the image region which shall be tracked

width and height of the image region


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

Generated on Sat Apr 10 15:27:29 2010 for LTI-Lib by Doxygen 1.6.1