Tracks and Steps
Figure 2. A PointMass Track with 8 Steps

A Track represents a single object or video feature that evolves over time. For each video frame, the track stores the image position and/or shape of the object in a Step. The step uses a TPoint array for data storage and interactive mouse control.
Tracks will interpret their steps by providing meaningful world data when queried. They also provide menus and toolbar components that enable users to control their properties with a mouse.
There are several types (subclasses) of tracks and each uses a different type of step, as shown in Table 1. The TPoints associated with each step type are given descriptive names.
Table 1. Tracks, Steps and TPoints
| Track | Step | TPoints |
| PointMass, CenterOfMass | PositionStep | position |
| Force, NetForce | VectorStep | tip, tail, center handle |
| CoordAxes | CoordAxesStep | origin, x-axis handle |
| TapeMeasure | TapeStep | end 1, end 2, center handle |
| OffsetOrigin | OffsetOriginStep | position |
| Calibration | CalibrationStep | position 1, position 2 |
| LineProfile | LineProfileStep | end 1, end 2, center handle |
Tracks implement the OSP Trackable and Interactive interfaces. Every track has a no-argument constructor.
Note: the base class for Tracker tracks is named TTrack rather than Track. This avoids confusion when working with QuickTime movies, which use a Track class to define video and audio tracks. In this tutorial, the word track always refers to a TTrack subclass.
Common Track and Step Methods
Methods that are implemented by all tracks and steps are shown in Listing 1. Here n refers to frame number, and x and y are imagespace coordinates.
Listing 1. Common Track and Step Methods
|
Track methods: managing steps Track methods: setting properties Track methods: getting data and components Step methods: |
TrackerPanel, an argument in the last four track methods listed, is a subclass of VideoPanel. Tracks use the tracker panel's coords to convert image positions into world data. TrackerPanel is discussed in the TrackerPanel section
Specific Track and Step Methods
Listings 2-6 shows methods defined by specific track and step types.
Listing 2. PointMass Methods
|
PointMass: CenterOfMass (extends PointMass): PositionStep: |
Listing 3. Force Methods
|
Force: NetForce (extends Force): VectorStep: |
Listing 4. CoordAxes and TapeMeasure Methods
|
CoordAxes: no unique methods CoordAxesStep: TapeMeasure: TapeStep: |
Listing 5. OffsetOrigin and Calibration Methods
|
OffsetOrigin: no unique methods OffsetOriginStep: Calibration: CalibrationStep: |
Listing 6. LineProfile Methods
|
LineProfile: LineProfileStep: |