CameraTriggerBase

class CameraTriggerBase[source]

Bases: object

Base class for defining custom camera trigger behavior.

Override this class to implement specific actions when an animal enters a detection area or reaches a specific position in the camera feed.

You have access to self.task, so any variable or function defined in the task can be used to specify the actions to perform.

__init__() None[source]

Initializes the CameraTriggerBase instance.

Methods

trigger(cam: Camera) None[source]

Evaluates camera triggers and performs corresponding actions.

Called on every frame to check whether the subject has entered any defined area or reached a specific position in the camera feed.

Available area triggers (return True if the area is marked as a TRIGGER area and a subject is detected within it): - cam.area1_is_triggered - cam.area2_is_triggered - cam.area3_is_triggered - cam.area4_is_triggered

Available position properties: - cam.x_position, cam.y_position (subject position in pixels) - cam.width, cam.height (camera feed dimensions in pixels)

Other: - cam.write_text(“text”) to overlay text on the camera feed

Parameters:
  • cam (Camera) – The camera instance providing trigger status

  • data. (and position)