File size: 676 Bytes
210ae8c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2f7897e
 
 
 
 
210ae8c
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import norfair
import numpy as np


def draw(
    paths_drawer,
    track_points,
    frame,
    detections,
    tracked_objects,
    coord_transformations,
    fix_paths,
):
    if fix_paths:
        frame = paths_drawer.draw(frame, tracked_objects, coord_transformations)
    elif paths_drawer is not None:
        frame = paths_drawer.draw(frame, tracked_objects)
    
    if track_points == "centroid":
        frame = norfair.draw_points(frame, tracked_objects, draw_ids=True)
    elif track_points == "bbox":
        frame = norfair.draw_boxes(frame, tracked_objects, draw_ids=True)

    return frame


def center(points):
    return [np.mean(np.array(points), axis=0)]