(img, tracks, fps)
| 15 | |
| 16 | |
| 17 | def draw_tracks(img, tracks, fps): |
| 18 | for track in tracks: |
| 19 | brect = track.GetBoundingRect() |
| 20 | if track.isStatic: |
| 21 | cv.rectangle(img, (brect.x, brect.y, brect.width, brect.height), (255, 0, 255), 2) |
| 22 | elif track.IsRobust(int(fps / 4), 0.7, (0.1, 10.), 3): |
| 23 | cv.rectangle(img, (brect.x, brect.y, brect.width, brect.height), (0, 255, 0), 2) |
| 24 | trajectory = track.GetTrajectory() |
| 25 | for i in range(0, len(trajectory) - 1): |
| 26 | cv.line(img, trajectory[i], trajectory[i+1], (0, 255, 0), 1) |
| 27 | |
| 28 | |
| 29 | def main(): |
no test coverage detected