Into

Modules

Documentation

classPiiExtendedCoordinateTracker

#include <PiiExtendedCoordinateTracker.h>

A tracker that follows trajectories in D dimensions.

Inherits PiiCoordinateTracker< T, D >

Description

It extends PiiCoordinateTracker by adding more sophisticated trajectory management facilities. PiiExtendedCoordinateTracker has the following properties:

  • Predicts constant movement for all objects based on two latest measurements.

  • New trajectories will be created for measurements that are either not connected to a trajectory or connected with a bad fitness value (see setGoodFitnessThreshold()). The fitness of such a new trajectory will be 1.0 - the maximum fitness compared to any candidate trajectory.

  • If a trajectory cannot be reliably continued (see setGoodFitnessThreshold()), the trajectory will be retained in candidate trajectories without extending it. This enhancement is needed to cope with missing measurements. Such trajectories are extended by cloning the last trajectory node.

  • If a trajectory has not been extended with new measurements for N (#setMaxStopTime()) iterations, it will be killed (endTrajectories()).

Public types

typedef PiiVector< T, D >
typedef PiiCoordinateTracker< T, D >
typedef PiiCoordinateTrackerNode< T, D >

Constructors and destructor

Public member functions

virtual void
( )

Add new measurements to the tracker.

double

Get the current good fitness threshold.

int

Get the current maximum prediction length.

int

Get the maximum stop time.

void
(
  • double goodFitnessThreshold
)

Set the threshold for good fitness.

void
(
  • int maximumPredictionLength
)

The maximum number of trajectory nodes between samples used for movement prediction.

void
(
  • int maximumStopTime
)

The maximum time a trajectory will stay alive without any measurements connected to it.

Protected member functions

virtual void
( )

Called when the tracker decides to get rid of a set of trajectories.

double
( )

Measure the likelihood of measurement belonging to trajectory at time instant t.

virtual double
( )

Evaluate the likelihood that measurement is a starting point of a new trajectory.

virtual MeasurementType *
( )

Predict the location of a measurement at the time instant t given a trajectory.

Function details

  • PiiExtendedCoordinateTracker

    ()
    [inline]
  • virtual void addMeasurements

    ( )
    [virtual]

    Add new measurements to the tracker.

    This function first creates a prediction for each active trajectory and then runs the tracking algorithm.

     PiiCoordinateTracker<int,2> tracker;
     typedef PiiTrackerPoint<int,2> Point;
     tracker.addMeasurements(QList<Point>() << Point(1,2) << Point(-1, 3), 0);
     tracker.addMeasurements(QList<Point>() << Point(4,3) << Point(-2, 5) << Point(-4, 8), 1);
    

    Reimplemented from PiiCoordinateTracker.

  • double goodFitnessThreshold

    ()
    [inline]

    Get the current good fitness threshold.

  • int maximumPredictionLength

    ()
    [inline]

    Get the current maximum prediction length.

  • int maximumStopTime

    ()
    [inline]

    Get the maximum stop time.

  • void setGoodFitnessThreshold

    (
    • double goodFitnessThreshold
    )
    [inline]

    Set the threshold for good fitness.

    "Good fitness" is a level of fitness that indicates a measurement is pretty close to the predicted position. Fitness values are within [0,1].

    The "good fitness" threshold is used in deciding whether a measurement can form a new candidate trajectory or not. If the maximum fitness of a sample compared to any of the current set of trajectories is less than or equal to this threshold, a new candidate will be formed. The fitness of the new trajectory will be 1.0 - the maximum fitness.

    If a trajectory cannot be extended with a measurement whose fitness greater than this value, a new candidate will be created by cloning the current end point of the trajectory. The default value, 0.0, causes the tracker to create a new trajectory only if the measurement cannot be connected to any of the current candidate trajectories.

  • void setMaximumPredictionLength

    (
    • int maximumPredictionLength
    )
    [inline]

    The maximum number of trajectory nodes between samples used for movement prediction.

    The default value is 1, which means that the difference between two previous samples will always be used. Setting the maximum prediction length to a larger value makes the estimate skip more samples in between, which should make the estimate more robust.

    Parameters
    maximumPredictionLength

    the maximum distance between nodes used for velocity estimation.

  • void setMaximumStopTime

    (
    • int maximumStopTime
    )
    [inline]

    The maximum time a trajectory will stay alive without any measurements connected to it.

    If this much time passes and a trajectory has not been extended, it needs to be ended. The tracker collects all such trajectories into a list it passes to endTrajectories().

    Parameters
    maximumStopTime

    the maximum amount of time a trajectory stays alive without measurements connected to it. The time is expressed in the units given as the t parameter to addMeasurements(). The default value is 1.

  • virtual void endTrajectories

    ( )
    [inline, protected, virtual]

    Called when the tracker decides to get rid of a set of trajectories.

    Subclasses may perform any functionality needed to close the trajectory in their overridden implementation. The default implementation deletes all trajectories. If you don't delete the trajectories yourself, make sure you remember to call this function in your overridden function.

    Parameters
    trajectories

    the trajectories that are just about to pass away. The ended trajectories will appear in this list in the same order they appeared in trajectories.

    t

    the current time instant

  • double measureFit

    ( )
    [protected]

    Measure the likelihood of measurement belonging to trajectory at time instant t.

    The default implementation computes squared distance between measurement and the trajectory's prediction (predict()). If they are equal, 1.0 will be returned. The returned value decreases linearly towards zero with (squared) distance until predictionThreshold is reached.

    If there is no prediction, measurement will be compared to the trajectory's last point. If the squared distance is within initialThreshold, 1.0 will be returned. Otherwise, 0.0 will be returned.

    Should measurement work as a starting point for a new trajectory, the tracker consults the measureFit(const MeasurementType&, int) function.

    Reimplemented from PiiCoordinateTracker.

  • virtual double measureFit

    ( )
    [protected, virtual]

    Evaluate the likelihood that measurement is a starting point of a new trajectory.

    The default implementation returns 1.0 when t is zero, 0.0 otherwise. This creates new trajectories on the first iteration only.

    Parameters
    measurement

    the measurement

    t

    the time instant

    Returns

    the likelihood (0-1) of the measurement being a new starting point.

    Reimplemented from PiiCoordinateTracker.

  • virtual MeasurementType * predict

    ( )
    [protected, virtual]

    Predict the location of a measurement at the time instant t given a trajectory.

    The function should return a pointer to a newly allocated measurement object. The tracker assumes the ownership of the pointer. If a prediction cannot be derived yet, zero must be returned. You need to implement this function as your movement model The default implementation returns 0.

    Parameters
    trajectory

    the trajectory on which the prediction will be based

    t

    the time instant for which the prediction should be given. The coordinate tracker always requests forward predictions, but it is in principle possible to predict backwards as well.

    Reimplemented from PiiCoordinateTracker.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.