MCPcopy Index your code
hub / github.com/FoundationVision/ByteTrack / fuse_motion

Function fuse_motion

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

to_xyahMethod · 0.45
gating_distanceMethod · 0.45

Tested by

no test coverage detected