|
6 | 6 | GOLDEN_RATIO = 0.618033988749895 |
7 | 7 |
|
8 | 8 |
|
9 | | -def draw_tracks(frame, tracks, draw_flow=False): |
| 9 | +def draw_tracks(frame, tracks, show_flow=False, show_cov=False): |
10 | 10 | for track in tracks: |
11 | 11 | draw_bbox(frame, track.tlbr, get_color(track.trk_id), 2, str(track.trk_id)) |
12 | | - if draw_flow: |
| 12 | + if show_flow: |
13 | 13 | draw_feature_match(frame, track.prev_keypoints, track.keypoints, (0, 255, 255)) |
| 14 | + if show_cov: |
| 15 | + draw_covariance(frame, track.tlbr, track.state[1]) |
14 | 16 |
|
15 | 17 |
|
16 | 18 | def draw_detections(frame, detections): |
@@ -79,6 +81,6 @@ def ellipse(cov): |
79 | 81 | return axes, angle |
80 | 82 |
|
81 | 83 | axes, angle = ellipse(covariance[:2, :2]) |
82 | | - cv2.ellipse(frame, tl, axes, angle, 0, 360, (255, 255, 255), 1) |
| 84 | + cv2.ellipse(frame, tl, axes, angle, 0, 360, (255, 255, 255), 1, cv2.LINE_AA) |
83 | 85 | axes, angle = ellipse(covariance[2:4, 2:4]) |
84 | | - cv2.ellipse(frame, br, axes, angle, 0, 360, (255, 255, 255), 1) |
| 86 | + cv2.ellipse(frame, br, axes, angle, 0, 360, (255, 255, 255), 1, cv2.LINE_AA) |
0 commit comments