ethoscope.drawers package¶
Submodules¶
ethoscope.drawers.drawers module¶
-
class
ethoscope.drawers.drawers.BaseDrawer(video_out=None, draw_frames=True, video_out_fourcc='DIVX', video_out_fps=2)[source]¶ Bases:
objectA template class to annotate and save the processed frames. It can also save the annotated frames in a video file and/or display them in a new window. The
_annotate_frame()abstract method defines how frames are annotated.Parameters: - video_out (str) – The path to the output file (.avi)
- draw_frames (bool) – Whether frames should be displayed on the screen (a new window will be created).
- video_out_fourcc (str) – When setting
video_out, this defines the codec used to save the output video (see fourcc) - video_out_fps (float) – When setting
video_out, this defines the output fps. typically, the same as the input fps.
-
draw(img, positions, tracking_units)[source]¶ Draw results on a frame.
Parameters: - img (
ndarray) – the frame that was just processed - positions (list(
DataPoint)) – a list of positions resulting from analysis of the frame by a tracker - tracking_units (list(
TrackingUnit)) – the tracking units corresponding to the positions
Returns: - img (
-
last_drawn_frame¶
-
class
ethoscope.drawers.drawers.DefaultDrawer(video_out=None, draw_frames=False)[source]¶ Bases:
ethoscope.drawers.drawers.BaseDrawerThe default drawer. It draws ellipses on the detected objects and polygons around ROIs. When an “interaction” see
BaseInteractorhappens within a ROI, the ellipse is red, blue otherwise.Parameters:
-
class
ethoscope.drawers.drawers.NullDrawer[source]¶ Bases:
ethoscope.drawers.drawers.BaseDrawerA drawer that does nothing (no video writing, no annotation, no display on the screen).
Returns: