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

lti::meanshiftTracker Class Reference

This is the implementation of the MEANSHIFT Tracking algorithm as described in: Comaniciu, Ramesh and Meer, "Real-Time Tracking of Non-Rigid Objects using the Mean Shift", IEEE Workshop on Applic.Comp.Vis.,2000. More...

#include <ltiMeanshiftTracker.h>

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

List of all members.

Classes

class  parameters
 the parameters for the class meanshiftTracker More...

Public Member Functions

 meanshiftTracker ()
 meanshiftTracker (const meanshiftTracker &other)
virtual ~meanshiftTracker ()
virtual const char * getTypeName () const
bool apply (const image &src, trectangle< int > &window)
bool isInitialized () const
void initialize (const image &src, trectangle< int > &window)
void initialize (const image &src, trectangle< int > &window, const channel8 &mask)
void initialize (const image &src, trectangle< int > &window, const channel &mask)
void reset ()
bool isValid () const
float getDistance () const
tpoint< float > getCenter () const
const thistogram< float > & getTargetHist () const
const thistogram< float > & getCandidateHist () const
meanshiftTrackercopy (const meanshiftTracker &other)
meanshiftTrackeroperator= (const meanshiftTracker &other)
virtual functorclone () const
const parametersgetParameters () const

Detailed Description

This is the implementation of the MEANSHIFT Tracking algorithm as described in: Comaniciu, Ramesh and Meer, "Real-Time Tracking of Non-Rigid Objects using the Mean Shift", IEEE Workshop on Applic.Comp.Vis.,2000.

It tracks a rectangular search window (the target) in an image by its color distribution. Therefore it uses an iterative gradient ascent algorithm, known as mean shift, that finds a similarity peak between target and candidate positions. The similarity is measured with a distance metric, which can be obtained after each apply().

Use this by calling an apply on subsequent images and thereby passing the last returned search rectangle. Initialization is done with first use or after a call of the reset() method.


Constructor & Destructor Documentation

lti::meanshiftTracker::meanshiftTracker (  ) 

default constructor

lti::meanshiftTracker::meanshiftTracker ( const meanshiftTracker other  ) 

copy constructor

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

destructor


Member Function Documentation

bool lti::meanshiftTracker::apply ( const image src,
trectangle< int > &  window 
)

Tracks a target color distribution.

The initial target is specified by "window" on first usage or after a reset() (i.e. tracker is not initialized). Subsequent calls of this method perform tracking by translating and scaling the "window" to optimally fit the target color distribution.

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

returns a pointer to a clone of this functor.

Implements lti::functor.

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

copy data of "other" functor.

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

Reimplemented from lti::functor.

const thistogram<float>& lti::meanshiftTracker::getCandidateHist (  )  const

returns a const reference to the histogram of the tracked candidate.

The histogram changes after each call of an apply method.

tpoint<float> lti::meanshiftTracker::getCenter (  )  const

returns the center of the tracked candidate distribution.

In general, this is the returned search windows center, except that the winwod is at the fringe of the image.

float lti::meanshiftTracker::getDistance (  )  const

returns the distance between the color distribution of the initial target and the last returned window.

const parameters& lti::meanshiftTracker::getParameters (  )  const

returns used parameters

Reimplemented from lti::modifier.

const thistogram<float>& lti::meanshiftTracker::getTargetHist (  )  const

returns a const reference to the histogram of the target.

The histogram only changes on initialization.

virtual const char* lti::meanshiftTracker::getTypeName (  )  const [virtual]

returns the name of this type ("meanshiftTracker")

Reimplemented from lti::modifier.

void lti::meanshiftTracker::initialize ( const image src,
trectangle< int > &  window,
const channel mask 
)

Explicitly initialize tracker with given region in image.

Additionally weight all pixels with the value in mask. You must call this explicitly, if you want to initialize with a weighting mask.

void lti::meanshiftTracker::initialize ( const image src,
trectangle< int > &  window,
const channel8 mask 
)

Explicitly initialize tracker with given region in image.

Additionally weight all pixels with the value in mask. You must call this explicitly, if you want to initialize with a weighting mask.

void lti::meanshiftTracker::initialize ( const image src,
trectangle< int > &  window 
)

Explicitly initialize tracker with given region in image.

This is called automatically when an apply is used while tracker is not initialised. I.e. calling initialize() is the same as subsequently calling reset() and apply().

bool lti::meanshiftTracker::isInitialized (  )  const

Tells, if the tracker has already been initialized with a target color distribution.

bool lti::meanshiftTracker::isValid (  )  const

Tells if returned window is valid.

This depends on the threshold parameter. If the color distribution distance between target and candidate window is above threshold, then this method returns false.

meanshiftTracker& lti::meanshiftTracker::operator= ( const meanshiftTracker other  ) 

alias for copy member

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

Reimplemented from lti::functor.

void lti::meanshiftTracker::reset (  ) 

Resets the tracker.

Next call of apply initializes it again.


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

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