latest version v1.9 - last update 10 Apr 2010 |
This functor implements a hierachical Lucas Kanade optical flow. More...
#include <ltiLkTracker.h>
Classes | |
class | parameters |
the parameters for the class lkTracker More... | |
class | vec2d |
a position/direction vector type More... | |
Public Member Functions | |
lkTracker () | |
lkTracker (const lkTracker &other) | |
virtual | ~lkTracker () |
virtual const char * | getTypeName () const |
bool | apply (const channel &src, pointList &featurePoints) |
bool | apply (const channel &src, pointList &featurePoints, int &validPoints) |
bool | apply (const channel &src, tpointList< float > &featurePoints) |
bool | apply (const channel &src, tpointList< float > &featurePoints, int &validPoints) |
bool | reset () |
bool | reset (const tpointList< float > &whichPoints) |
bool | reset (const pointList &whichPoints) |
lkTracker & | copy (const lkTracker &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Static Public Attributes | |
static const tpoint< float > | outOfRange |
This functor implements a hierachical Lucas Kanade optical flow.
It is used for feature tracking through a image sequence. Therefore it uses a corner detector to find the initial features
For more details please look at Jean-Yves Bouguet's paper Pyramidal Implementation of the Lucas Kanade Feature Tracker. Description of the algorithm
lti::lkTracker::lkTracker | ( | ) |
default constructor
lti::lkTracker::lkTracker | ( | const lkTracker & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::lkTracker::~lkTracker | ( | ) | [virtual] |
destructor
bool lti::lkTracker::apply | ( | const channel & | src, | |
tpointList< float > & | featurePoints, | |||
int & | validPoints | |||
) |
Track the points in the src channel and return the new positions in the given point list.
src | the channel with the points being tracked. The first presentation (or the next presentation after a reset() ) is used for initialization only. The next ones are used to track the first given point set, and the results will be left in featurePoints . | |
featurePoints | the first time the apply is called (or after a reset() ), this list contain the positions of the points to track. If the attribute autoCorners of the parameters is true, the content of this list will be discarded and the positions of the automatic detected corners will be left here. Points getting invalid during tracking are marked by negative values in the point list. | |
validPoints | returns the number of valid points in the list featurePoints |
bool lti::lkTracker::apply | ( | const channel & | src, | |
tpointList< float > & | featurePoints | |||
) |
Track the points in the src channel and return the new positions in the given point list.
src | the channel with the points being tracked. The first presentation (or the next presentation after a reset() ) is used for initialization only. The next ones are used to track the first given point set, and the results will be left in featurePoints . | |
featurePoints | the first time the apply is called (or after a reset() ), this list contain the positions of the points to track. If the attribute autoCorners of the parameters is true, the content of this list will be discarded and the positions of the automatic detected corners will be left here. Points getting invalid during tracking are marked by negative values in the point list. |
Track the points in the src channel and return the new positions in the given point list.
Please note that internally the pointList contains points with float
precision, and to return an pointList
they need to be casted. Is faster if you try to use directly the other apply member, which works directly with the float-points.
src | the channel with the points being tracked. The first presentation (or the next presentation after a reset() ) is used for initialization only. The next ones are used to track the first given point set, and the results will be left in featurePoints . | |
featurePoints | the first time the apply is called (or after a reset() ), this list contain the positions of the points to track. If the attribute autoCorners of the parameters is true, the content of this list will be discarded and the positions of the automatic detected corners will be left here. Points getting invalid during tracking are marked by negative values in the point list. | |
validPoints | returns the number of valid points in the list feature points. |
Track the points in the src channel and return the new positions in the given point list.
Please note that internally the pointList contains points with float
precision, and to return an pointList
they need to be casted. Is faster if you try to use directly the other apply member, which works directly with the float-points.
src | the channel with the points being tracked. The first presentation (or the next presentation after a reset() ) is used for initialization only. The next ones are used to track the first given point set, and the results will be left in featurePoints . | |
featurePoints | the first time the apply is called (or after a reset() ), this list contain the positions of the points to track. If the attribute autoCorners of the parameters is true, the content of this list will be discarded and the positions of the automatic detected corners will be left here. Points getting invalid during tracking are marked by negative values in the point list. |
virtual functor* lti::lkTracker::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
const parameters& lti::lkTracker::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::modifier.
virtual const char* lti::lkTracker::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("lkTracker")
Reimplemented from lti::modifier.
bool lti::lkTracker::reset | ( | const pointList & | whichPoints | ) |
Reset some points in the tracking list.
Please note that this reset takes effect only if there is already a tracking point list in the functor, i.e. if a "total" reset was already done followed by an apply.
whichPoints | Only those points in the list with valid values (coordinates > 0) will be reset: they will get this valid value. All invalid points in the list, i.e. with coordinates lower than zero will be keped as they are. Please note that point sequence in this list must correspond to the sequence of the tracking list! |
bool lti::lkTracker::reset | ( | const tpointList< float > & | whichPoints | ) |
Reset some points in the tracking list.
Please note that this reset takes effect only if there is already a tracking point list in the functor, i.e. if a "total" reset was already done followed by an apply.
whichPoints | Only those points in the list with valid values (coordinates > 0) will be reset: they will get this valid value. All invalid points in the list, i.e. with coordinates lower than zero will be keped as they are. Please note that point sequence in this list must correspond to the sequence of the tracking list! |
bool lti::lkTracker::reset | ( | ) |
Resets the internal state but not the parameters.
const tpoint<float> lti::lkTracker::outOfRange [static] |
constant which describes a point outOfRange.
In general, a point with negative coordinates can be considered out of range