A single target track with state space `(x, y, a, h)` and associated velocities, where `(x, y)` is the center of the bounding box, `a` is the aspect ratio and `h` is the height. Parameters ---------- mean : ndarray Mean vector of the initial state distribution. c
| 16 | |
| 17 | |
| 18 | class Track: |
| 19 | """ |
| 20 | A single target track with state space `(x, y, a, h)` and associated |
| 21 | velocities, where `(x, y)` is the center of the bounding box, `a` is the |
| 22 | aspect ratio and `h` is the height. |
| 23 | Parameters |
| 24 | ---------- |
| 25 | mean : ndarray |
| 26 | Mean vector of the initial state distribution. |
| 27 | covariance : ndarray |
| 28 | Covariance matrix of the initial state distribution. |
| 29 | track_id : int |
| 30 | A unique track identifier. |
| 31 | n_init : int |
| 32 | Number of consecutive detections before the track is confirmed. The |
| 33 | track state is set to `Deleted` if a miss occurs within the first |
| 34 | `n_init` frames. |
| 35 | max_age : int |
| 36 | The maximum number of consecutive misses before the track state is |
| 37 | set to `Deleted`. |
| 38 | feature : Optional[ndarray] |
| 39 | Feature vector of the detection this track originates from. If not None, |
| 40 | this feature is added to the `features` cache. |
| 41 | Attributes |
| 42 | ---------- |
| 43 | mean : ndarray |
| 44 | Mean vector of the initial state distribution. |
| 45 | covariance : ndarray |
| 46 | Covariance matrix of the initial state distribution. |
| 47 | track_id : int |
| 48 | A unique track identifier. |
| 49 | hits : int |
| 50 | Total number of measurement updates. |
| 51 | age : int |
| 52 | Total number of frames since first occurance. |
| 53 | time_since_update : int |
| 54 | Total number of frames since last measurement update. |
| 55 | state : TrackState |
| 56 | The current track state. |
| 57 | features : List[ndarray] |
| 58 | A cache of features. On each measurement update, the associated feature |
| 59 | vector is added to this list. |
| 60 | """ |
| 61 | |
| 62 | def __init__(self, mean, covariance, track_id, class_id, n_init, max_age, |
| 63 | feature=None): |
| 64 | self.mean = mean |
| 65 | self.covariance = covariance |
| 66 | self.track_id = track_id |
| 67 | self.class_id = class_id |
| 68 | self.hits = 1 |
| 69 | self.age = 1 |
| 70 | self.time_since_update = 0 |
| 71 | |
| 72 | self.state = TrackState.Tentative |
| 73 | self.features = [] |
| 74 | if feature is not None: |
| 75 | self.features.append(feature) |