# opentl::tracker::Tracker Class Reference

Abstract base class for all trackers to come. More...

Inherited by opentl::tracker::DummyTracker, opentl::tracker::InfoFilter, opentl::tracker::Kalman, opentl::tracker::MCMCParticle, opentl::tracker::SIRParticle, and opentl::tracker::UnscentedInfoFilter.

List of all members.

## Public Types
## Public Member Functions
virtual void | addExplicitLikelihoodInstances (std::size_t count=1)
| Add additional likelihood instances (for multiple threads) Instances ares cloned from the likelihood template and represent the whole pipeline.
virtual void | addImplicitLikelihoodInstances (std::size_t count=1)
virtual void | computeOutputState (opentl::models::Target &target, std::size_t burnInSamples=0)
| Compute output state (weighted particle mean).
virtual void | computeOutputStateAndPoseCovariance (opentl::models::Target &target, math::SquareMatrix *poseCov=NULL, std::size_t burnInSamples=0)
| Compute weighted particle mean and covariance (of the finite pose parameters only).
virtual void | correct (TargetPtrVector &targets)=0
| Correct: perform a measurement (using the Likelihood) and update the posterior distribution of all targets.
virtual bool | detectLoss (boost::shared_ptr< opentl::models::Target > target, double value, TrackLoss method=DETERMINANT)
| Function to detect a target loss.
core::cvdata::T_MEAS_LIK * | getExplicitMeas (std::size_t threadNum, std::size_t targetNum)
| Obtain the explicit measurement for a given thread and target.
opentl::modalities::Likelihood::T_LIK_MODALITY_FEATURE * | getInternalFeatModality (int m, std::size_t threadId) const
opentl::modalities::Likelihood::T_LIK_MODALITY_OBJECT * | getInternalObjModality (int m, std::size_t threadId) const
opentl::modalities::Likelihood::T_LIK_MODALITY_PIXEL * | getInternalPixModality (int m, std::size_t threadId) const
opentl::modalities::Likelihood * | getLikelihood (std::size_t i)
virtual void | init (TargetPtrVector &targets, std::vector< boost::shared_ptr< opentl::core::State > > *initStates=NULL, std::vector< boost::shared_ptr< math::SquareMatrix > > *initCovs=NULL, std::vector< int > *nHypotheses=NULL)=0
| Initialize: allocate internal data, and update warp, for all targets.
virtual void | predict (TargetPtrVector &targets)=0
| Predict: compute the prior distribution of all targets from the last posterior, using the dynamical model.
virtual void | resizeExplicitMeasurements (int nOfTargets)
| resize the measurements for each likelihood instance (for multiple targets
int | sampleModelFeatures (const TargetPtrVector &targets, std::size_t threadId)
| Call (recursively) the sampleModelFeatures method for the whole processing tree.
| Tracker (const opentl::modalities::Likelihood &likelihood, opentl::modelprojection::Warp &warp)
| constructor (objectModels are created dynamically) Use this constructor for varying targets
int | updateModelFeatures (const TargetPtrVector &targets, std::size_t threadId)
| Call (recursively) the updateModelFeatures method for the whole processing tree.
virtual | ~Tracker ()
| destructor
## Protected Member Functions
virtual void | output (TargetPtrVector &targets)
| Compute the output state for all targets.
## Protected Attributes
std::vector< boost::shared_ptr < modalities::Likelihood > > | mLikelihoods
const opentl::modalities::Likelihood & | mLikelihoodTemplate
std::vector< T_MEAS_LIKPtrVector > | mLikMeasExplicit
opentl::modelprojection::Warp & | mWarp
| Main warp class, needed because the correction and prediction steps call the warpUpdate() for the respective state vectors.

## Detailed Description

Abstract base class for all trackers to come.

Author:

The aim of this class is, to provide the two main tracking functions PREDICT and CORRECT All inherited trackers should implement these functions, so the user (or the algorithm) does not need to know how the filter works exactly but has just to call these functions.

## Member Enumeration Documentation

enum opentl::tracker::Tracker::TrackLoss

Method to determine a lost track.

Enumerator:

  DETERMINANT | Use the determinant of the covariance matrix.
  LIKELIHOOD | Use the internal weights (likelihoods) - only for particle filters.

## Constructor & Destructor Documentation

opentl::tracker::Tracker::Tracker | ( | const opentl::modalities::Likelihood & | likelihood,
|  | opentl::modelprojection::Warp & | warp |
| ) |  |  |

constructor (objectModels are created dynamically) Use this constructor for varying targets

virtual opentl::tracker::Tracker::~Tracker | ( |  | ) | `[virtual]`

destructor

## Member Function Documentation

virtual void opentl::tracker::Tracker::addExplicitLikelihoodInstances | ( | std::size_t | count = `1` | ) | `[virtual]`

Add additional likelihood instances (for multiple threads) Instances ares cloned from the likelihood template and represent the whole pipeline.

virtual void opentl::tracker::Tracker::addImplicitLikelihoodInstances | ( | std::size_t | count = `1` | ) | `[virtual]`

virtual void opentl::tracker::Tracker::computeOutputState | ( | opentl::models::Target & | target,
|  | std::size_t | burnInSamples = `0` |
| ) |  |  | `[virtual]`

Compute output state (weighted particle mean).

virtual void opentl::tracker::Tracker::computeOutputStateAndPoseCovariance | ( | opentl::models::Target & | target,
|  | math::SquareMatrix * | poseCov = `NULL`,
|  | std::size_t | burnInSamples = `0` |
| ) |  |  | `[virtual]`

Compute weighted particle mean and covariance (of the finite pose parameters only).

Parameters:

  | target | Single target distribution
  | poseCov | (optional) Output pose covariance
  | burnInSamples | (optional) Burn-in samples, to be discarded from the computation

virtual void opentl::tracker::Tracker::correct | ( | TargetPtrVector & | targets | ) | `[pure virtual]`

Correct: perform a measurement (using the Likelihood) and update the posterior distribution of all targets.

Parameters:

  | targets | Vector of targets

Implemented in opentl::tracker::DummyTracker, opentl::tracker::InfoFilter, opentl::tracker::Kalman, opentl::tracker::MCMCParticle, opentl::tracker::SIRParticle, and opentl::tracker::UnscentedInfoFilter.

virtual bool opentl::tracker::Tracker::detectLoss | ( | boost::shared_ptr< opentl::models::Target > | target,
|  | double | value,
|  | TrackLoss | method = `DETERMINANT` |
| ) |  |  | `[virtual]`

Function to detect a target loss.

core::cvdata::T_MEAS_LIK* opentl::tracker::Tracker::getExplicitMeas | ( | std::size_t | threadNum,
|  | std::size_t | targetNum |
| ) |  |  |

Obtain the explicit measurement for a given thread and target.

Parameters:

  | threadNum | Index of the target
  | targetNum | Index of the target

Returns:
  Pointer to the explicit measurement structure

opentl::modalities::Likelihood::T_LIK_MODALITY_FEATURE* opentl::tracker::Tracker::getInternalFeatModality | ( | int | m,
|  | std::size_t | threadId |
| ) |  |  | const

opentl::modalities::Likelihood::T_LIK_MODALITY_OBJECT* opentl::tracker::Tracker::getInternalObjModality | ( | int | m,
|  | std::size_t | threadId |
| ) |  |  | const

opentl::modalities::Likelihood::T_LIK_MODALITY_PIXEL* opentl::tracker::Tracker::getInternalPixModality | ( | int | m,
|  | std::size_t | threadId |
| ) |  |  | const

opentl::modalities::Likelihood* opentl::tracker::Tracker::getLikelihood | ( | std::size_t | i | ) |

virtual void opentl::tracker::Tracker::init | ( | TargetPtrVector & | targets,
|  | std::vector< boost::shared_ptr< opentl::core::State > > * | initStates = `NULL`,
|  | std::vector< boost::shared_ptr< math::SquareMatrix > > * | initCovs = `NULL`,
|  | std::vector< int > * | nHypotheses = `NULL` |
| ) |  |  | `[pure virtual]`

Initialize: allocate internal data, and update warp, for all targets.

Parameters:

  | targets | Vector of targets
  | initStates | Vector of initial states (optional); it must have same size of targets
  | initCovs | Vector of initial covariances (optional); it must have the same size of targets
  | nHypotheses | Vector with number of state hypotheses for each target distribution; it must have same size of targets

Implemented in opentl::tracker::DummyTracker, opentl::tracker::InfoFilter, opentl::tracker::Kalman, opentl::tracker::MCMCParticle, opentl::tracker::SIRParticle, and opentl::tracker::UnscentedInfoFilter.

virtual void opentl::tracker::Tracker::output | ( | TargetPtrVector & | targets | ) | `[protected, virtual]`

Compute the output state for all targets.

Parameters:

  | targets | Vector of targets

Reimplemented in opentl::tracker::DummyTracker, opentl::tracker::InfoFilter, opentl::tracker::Kalman, opentl::tracker::MCMCParticle, opentl::tracker::SIRParticle, and opentl::tracker::UnscentedInfoFilter.

virtual void opentl::tracker::Tracker::predict | ( | TargetPtrVector & | targets | ) | `[pure virtual]`

Predict: compute the prior distribution of all targets from the last posterior, using the dynamical model.

Parameters:

  | targets | Vector of targets

Implemented in opentl::tracker::DummyTracker, opentl::tracker::InfoFilter, opentl::tracker::Kalman, opentl::tracker::MCMCParticle, opentl::tracker::SIRParticle, and opentl::tracker::UnscentedInfoFilter.

virtual void opentl::tracker::Tracker::resizeExplicitMeasurements | ( | int | nOfTargets | ) | `[virtual]`

resize the measurements for each likelihood instance (for multiple targets

int opentl::tracker::Tracker::sampleModelFeatures | ( | const TargetPtrVector & | targets,
|  | std::size_t | threadId |
| ) |  |  |

Call (recursively) the sampleModelFeatures method for the whole processing tree.

int opentl::tracker::Tracker::updateModelFeatures | ( | const TargetPtrVector & | targets,
|  | std::size_t | threadId |
| ) |  |  |

Call (recursively) the updateModelFeatures method for the whole processing tree.

## Member Data Documentation

std::vector<boost::shared_ptr<modalities::Likelihood> > opentl::tracker::Tracker::mLikelihoods`[protected]`

const opentl::modalities::Likelihood& opentl::tracker::Tracker::mLikelihoodTemplate`[protected]`

std::vector<T_MEAS_LIKPtrVector> opentl::tracker::Tracker::mLikMeasExplicit`[protected]`

opentl::modelprojection::Warp& opentl::tracker::Tracker::mWarp`[protected]`

Main warp class, needed because the correction and prediction steps call the warpUpdate() for the respective state vectors.