MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / fuse_motion

Function fuse_motion

tutorials/trades/mot_online/matching.py:185–196  ·  view source on GitHub ↗
(kf, cost_matrix, tracks, detections, only_position=False, lambda_=0.98)

Source from the content-addressed store, hash-verified

183
184
185def fuse_motion(kf, cost_matrix, tracks, detections, only_position=False, lambda_=0.98):
186 if cost_matrix.size == 0:
187 return cost_matrix
188 gating_dim = 2 if only_position else 4
189 gating_threshold = chi2inv95[gating_dim]
190 measurements = np.asarray([det.to_xyah() for det in detections])
191 for row, track in enumerate(tracks):
192 gating_distance = kf.gating_distance(
193 track.mean, track.covariance, measurements, only_position, metric='maha')
194 cost_matrix[row, gating_distance > gating_threshold] = np.inf
195 cost_matrix[row] = lambda_ * cost_matrix[row] + (1 - lambda_) * gating_distance
196 return cost_matrix

Callers

nothing calls this directly

Calls 2

to_xyahMethod · 0.45
gating_distanceMethod · 0.45

Tested by

no test coverage detected