Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Attributes
icl::cv::VectorTracker Class Reference

Extension of the position tracker class for N-dimensional positions. More...

#include <VectorTracker.h>

List of all members.

Public Types

enum  IDmode { firstFree, brandNew }
 Determines how ids are allocated internally. More...
typedef std::vector< float > Vec
 Vector Type.

Public Member Functions

 VectorTracker ()
 Creates an empty (null) vector tracker (isNull() returns true then)
 VectorTracker (int dim, float largeDistance, const std::vector< float > &normFactors=std::vector< float >(), IDmode idMode=firstFree, float distanceThreshold=0, bool tryOpt=true)
 Creates new VectorTracker instance with given parameters.
 VectorTracker (const VectorTracker &other)
 Deep copy constructor (all data and current state is copied deeply)
VectorTrackeroperator= (const VectorTracker &other)
 assignment (all data and current state is copied deeply)
 ~VectorTracker ()
 Destructor.
void pushData (const std::vector< Vec > &newData)
 next step function most efficient version
int getID (int index) const
 returns runtime id of last pushed data element index
bool isNull () const
 returns whether VectorTracker instance is currently null (created with default constructor)
int getDim () const
 return current data dimension
void setExtrapolationMask (const std::vector< bool > &mask)
 internally sets the extrapolation mask
const std::vector< bool > & getExtrapolationMask () const
 returns current extrapolation mask

Private Attributes

Data * m_data
 internal data pointer

Detailed Description

Extension of the position tracker class for N-dimensional positions.

Here's a copy of the PositionTracker documentation, which assumes 2D-input data:

Class for tracking 2D positions.


Member Typedef Documentation

typedef std::vector<float> icl::cv::VectorTracker::Vec

Vector Type.


Member Enumeration Documentation

Determines how ids are allocated internally.

Enumerator:
firstFree 
brandNew 

Constructor & Destructor Documentation

Creates an empty (null) vector tracker (isNull() returns true then)

icl::cv::VectorTracker::VectorTracker ( int  dim,
float  largeDistance,
const std::vector< float > &  normFactors = std::vector< float >(),
IDmode  idMode = firstFree,
float  distanceThreshold = 0,
bool  tryOpt = true 
)

Creates new VectorTracker instance with given parameters.

Parameters:
dimdata dimension (this must not changed at runtime)
largeDistanceto tackle element count changes, the distance matrix is padded with largeDistnace values, this must be much (e.g. 100 times ) larger then the largest real distance, that can be expected from the data. We can't use some fixed value here, as too large values lead to numerical problems
normFactorsInternally the euclidian distance metric can be normalized in differenct dimensions seperately:

\[ d(a,b) = \sqrt{ \sum\limits_{i=1}^D \left( \frac{a_i - b_i}{\sigma_i}\right)^2 } \]

In literature this is norm is reference as normalized euclidian distance. Actually we use an adapted instance of this norm:

\[ d(a,b) = \sqrt[4]{ \sum\limits_{i=1}^D \left( \frac{a_i - b_i}{\sigma_i}\right)^2 } \]

As mentioned in the documentation of the PositionTracker, it's compulsory to use the root of the actual norm to avoid new entries are mixed up with old ones. The norm factor vector contains the $\sigma_i$ that are used in the formula above. If norm-factor is empty or all entries are set to 1, the default euclidian norm (more precisely the square root of it) is used, which increases performance slightly. If normFactor contains zeros, div-0 errors would occur, so this is checked during initialization.
idModeThis feature is taken from the recent PositionTracker update. It decides whether to re-use old IDs, that got free again due to the disappearing of the associated entry or to assign a brand new ID each time a new entry is found
distanceThresholdAs a first optimization a trivial assignment is tested. If entry count hasn't changed and each old entry can be assigned indisputably to a single new entry and each distance between estimation and current observation is beyond that threshold, the trivial assignment is used.
tryOptenables/disables whether to test for trivial assignment. If a trivial assignment can be expected, this will increase performance significantly. If it's more likely, that trivial assignment will fail, this also reduce performance a little bit.

Deep copy constructor (all data and current state is copied deeply)

New instance is absolutely independent from the source instance

Destructor.


Member Function Documentation

return current data dimension

const std::vector<bool>& icl::cv::VectorTracker::getExtrapolationMask ( ) const

returns current extrapolation mask

int icl::cv::VectorTracker::getID ( int  index) const

returns runtime id of last pushed data element index

returns whether VectorTracker instance is currently null (created with default constructor)

VectorTracker& icl::cv::VectorTracker::operator= ( const VectorTracker other)

assignment (all data and current state is copied deeply)

New instance is absolutely independent from the source instance

void icl::cv::VectorTracker::pushData ( const std::vector< Vec > &  newData)

next step function most efficient version

void icl::cv::VectorTracker::setExtrapolationMask ( const std::vector< bool > &  mask)

internally sets the extrapolation mask

By default, the mask contains only true-entries. All dimensions of current date, that have a true-entry in the mask are extrapolated using a linear model before the internal cost-matrix is created (and if this entry has an age of at least 2 -- so two former entries are available). Dimensions that have a false-entry in the given mask are not-extrapolated over time (which is identical to using a constant extrapolation model)


Member Data Documentation

internal data pointer


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines