6 Enumeration type for the single target track state. Newly created tracks are 7 classified as `tentative` until enough evidence has been collected. Then, 8 the track state is changed to `confirmed`. Tracks that are no longer alive 9 are classified as `deleted` to mark them for removal from the set of active 21 A single target track with state space `(x, y, a, h)` and associated 22 velocities, where `(x, y)` is the center of the bounding box, `a` is the 23 aspect ratio and `h` is the height. 28 Mean vector of the initial state distribution. 30 Covariance matrix of the initial state distribution. 32 A unique track identifier. 34 Number of consecutive detections before the track is confirmed. The 35 track state is set to `Deleted` if a miss occurs within the first 38 The maximum number of consecutive misses before the track state is 40 feature : Optional[ndarray] 41 Feature vector of the detection this track originates from. If not None, 42 this feature is added to the `features` cache. 47 Mean vector of the initial state distribution. 49 Covariance matrix of the initial state distribution. 51 A unique track identifier. 53 Total number of measurement updates. 55 Total number of frames since first occurance. 56 time_since_update : int 57 Total number of frames since last measurement update. 59 The current track state. 60 features : List[ndarray] 61 A cache of features. On each measurement update, the associated feature 62 vector is added to this list. 66 def __init__(self, mean, covariance, track_id, n_init, max_age,
75 self.
state = TrackState.Tentative
77 if feature
is not None:
78 self.features.append(feature)
84 """Get current position in bounding box format `(top left x, top left y, 93 ret = self.
mean[:4].copy()
95 ret[:2] -= ret[2:] / 2
99 """Get current position in bounding box format `(min x, miny, max x, 109 ret[2:] = ret[:2] + ret[2:]
113 """Propagate the state distribution to the current time step using a 114 Kalman filter prediction step. 118 kf : kalman_filter.KalmanFilter 127 """Perform Kalman filter measurement update step and update the feature 132 kf : kalman_filter.KalmanFilter 134 detection : Detection 135 The associated detection. 140 self.features.append(detection.feature)
145 self.
state = TrackState.Confirmed
148 """Mark this track as missed (no association at the current time step). 150 if self.
state == TrackState.Tentative:
151 self.
state = TrackState.Deleted
153 self.
state = TrackState.Deleted
156 """Returns True if this track is tentative (unconfirmed). 158 return self.
state == TrackState.Tentative
161 """Returns True if this track is confirmed.""" 162 return self.
state == TrackState.Confirmed
165 """Returns True if this track is dead and should be deleted.""" 166 return self.
state == TrackState.Deleted
def __init__(self, mean, covariance, track_id, n_init, max_age, feature=None)
def update(self, kf, detection)