latest version v1.9 - last update 10 Apr 2010 |
This is the implementation of the CAMSHIFT (Continuously Adaptive Mean Shift) Tracking algorithm as described in: G.Bradski, "Computer Vision Face Tracking For Use in a Perceptual User Interface", IEEE Workshop on Applic.Comp.Vis.,1998. More...
#include <ltiCamshiftTracker.h>
Classes | |
class | parameters |
the parameters for the class camshiftTracker More... | |
Public Member Functions | |
camshiftTracker () | |
camshiftTracker (const camshiftTracker &other) | |
virtual | ~camshiftTracker () |
virtual const char * | getTypeName () const |
bool | apply (const channel &src, rectangle &window) |
bool | apply (const channel8 &src, rectangle &window) |
bool | reset () |
bool | isInitialized () |
bool | isValid () |
double | getOrientation () |
double | getLength () |
double | getWidth () |
tpoint< float > | getCenter () |
camshiftTracker & | copy (const camshiftTracker &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
This is the implementation of the CAMSHIFT (Continuously Adaptive Mean Shift) Tracking algorithm as described in: G.Bradski, "Computer Vision Face Tracking For Use in a Perceptual User Interface", IEEE Workshop on Applic.Comp.Vis.,1998.
It tracks a rectangular search window in a channel/channel8, which must contain probability information of relevant image content (e.g. a skinProbabilityMap). It uses an iterative gradient ascent algorithm, that finds the peak, which is the closest to the specified window.
Use this by calling an apply on subsequent images and thereby passing the last result. Nevertheless, it is possible to control rectangle size and position manually.
After an apply you can get Information about the distribution inside the search window (e.g. orientation). Use the getXXX() methods to do so.
lti::camshiftTracker::camshiftTracker | ( | ) |
default constructor
lti::camshiftTracker::camshiftTracker | ( | const camshiftTracker & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::camshiftTracker::~camshiftTracker | ( | ) | [virtual] |
destructor
Centers the given search window on the nearest probability peak.
Tracking is realised by using this rectangle in the next call of this function. Information about the distribution inside the search window is stored and can be retrieved by using the getXXXX() methods of this functor.
src | channel8 with the source data. Should represent a probability map (prob(0)=0.0 and prob(255)=1.0) | |
window | the tracking window. Result will be left here. |
Centers the given search window on the nearest probability peak.
Tracking is realised by using this rectangle in the next call of this function. Information about the distribution inside the search window is stored and can be retrieved by using the getXXXX() methods of this functor.
src | channel with the source data. Should represent a probability map with values between 0.0 and 1.0 | |
window | the tracking window. Result will be left here. |
virtual functor* lti::camshiftTracker::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
camshiftTracker& lti::camshiftTracker::copy | ( | const camshiftTracker & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
tpoint<float> lti::camshiftTracker::getCenter | ( | ) |
Returns center of current internal distribution state.
double lti::camshiftTracker::getLength | ( | ) |
Returns length of current internal distribution state.
double lti::camshiftTracker::getOrientation | ( | ) |
Returns Main orientation (-Pi/2 to +Pi/2) of current internal distribution state.
const parameters& lti::camshiftTracker::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::modifier.
virtual const char* lti::camshiftTracker::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("camshiftTracker")
Reimplemented from lti::modifier.
double lti::camshiftTracker::getWidth | ( | ) |
Returns width of current internal distribution state.
bool lti::camshiftTracker::isInitialized | ( | ) |
Tells, if tracker is initialized.
bool lti::camshiftTracker::isValid | ( | ) |
Tells, if last tracking attempt delivered valid data.
bool lti::camshiftTracker::reset | ( | ) |
Resets the internal state but not the parameters.