(kf, cost_matrix, tracks, detections, only_position=False)
| 172 | return track_features, det_features, cost_matrix, cost_matrix_det, cost_matrix_track |
| 173 | |
| 174 | def gate_cost_matrix(kf, cost_matrix, tracks, detections, only_position=False): |
| 175 | if cost_matrix.size == 0: |
| 176 | return cost_matrix |
| 177 | gating_dim = 2 if only_position else 4 |
| 178 | gating_threshold = chi2inv95[gating_dim] |
| 179 | measurements = np.asarray([det.to_xyah() for det in detections]) |
| 180 | for row, track in enumerate(tracks): |
| 181 | gating_distance = kf.gating_distance( |
| 182 | track.mean, track.covariance, measurements, only_position) |
| 183 | cost_matrix[row, gating_distance > gating_threshold] = np.inf |
| 184 | return cost_matrix |
| 185 | |
| 186 | |
| 187 | def fuse_motion(kf, cost_matrix, tracks, detections, only_position=False, lambda_=0.98): |
nothing calls this directly
no test coverage detected