MCPcopy Create free account
hub / github.com/Smorodov/Multitarget-tracker / draw_tracks

Function draw_tracks

demo.py:17–26  ·  view source on GitHub ↗
(img, tracks, fps)

Source from the content-addressed store, hash-verified

15
16
17def 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
29def main():

Callers 1

mainFunction · 0.70

Calls 3

GetBoundingRectMethod · 0.80
IsRobustMethod · 0.80
GetTrajectoryMethod · 0.80

Tested by

no test coverage detected