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

Function gate_cost_matrix

yolox/tracker/matching.py:132–142  ·  view source on GitHub ↗
(kf, cost_matrix, tracks, detections, only_position=False)

Source from the content-addressed store, hash-verified

130
131
132def gate_cost_matrix(kf, cost_matrix, tracks, detections, only_position=False):
133 if cost_matrix.size == 0:
134 return cost_matrix
135 gating_dim = 2 if only_position else 4
136 gating_threshold = kalman_filter.chi2inv95[gating_dim]
137 measurements = np.asarray([det.to_xyah() for det in detections])
138 for row, track in enumerate(tracks):
139 gating_distance = kf.gating_distance(
140 track.mean, track.covariance, measurements, only_position)
141 cost_matrix[row, gating_distance > gating_threshold] = np.inf
142 return cost_matrix
143
144
145def fuse_motion(kf, cost_matrix, tracks, detections, only_position=False, lambda_=0.98):

Callers

nothing calls this directly

Calls 2

to_xyahMethod · 0.45
gating_distanceMethod · 0.45

Tested by

no test coverage detected