Skip to content

Triggers

Q-engineering edited this page Aug 13, 2022 · 16 revisions

Trigger

A trigger warns you when a particular object is detected. There are three types of triggers.

  • An email trigger that sends you an email.
  • A recording trigger that starts a recording.
  • A GPIO trigger sets a GPIO output pin high (or low).

The first two are available in the email version, the latter only on the GPIO YoloCam.
Different triggers can be combined.

The trigger files are always stored in the /mnt/WRdisk folder, the only folder that is writable when the overlay is active.

output image

Recording trigger

Recoding triggers are listed in the comma separated TrigRec.csv file.
The file has the following structure.

Label Probability Move Area

Label
    One of 80 different objects to detect. For example 'car' or 'horse'. Upper or lower case doesn't matter.
Probability
    The probability indicates how well the object is recognized. The lower this number, the more likely a mistake occurs, for instance, a car instead of a truck.
Move
    Indicates the movement of the object. The parameter allows you to filter out static objects, for example, parked cars. Zero (0) disables the parameter.
Area
    Represents the ratio of the area of the recognized object to the entire image. Very small objects of a few pixels can be filtered out in this way.

An example

person , 50 , 10.5 , 0.5  
car    , 50 , 20.0 , 0.8   
bicycle, 50 , 5.5 , 0.5 

A recording starts when a person or a car or a bicycle are recognized in the camera scene. They all have to above 50% probability.
A person has to move 10.5%, a car 20.0% and the bicycle only 5.5%. These figures are found by trial and error.
A person needs to occupy 0.5% of the scene (640 x 480 x 0.005 = 1536 pixels). Smaller areas are too unreliable.
A car needs to be 0.8% before its been detected. And a bicycle Inline $$(\sqrt{3x-1}+(1+x)^2)$$

Email trigger

The csv file for the email has the following structure.

Label Probability Move Area Prio

Prio
    Prioritize the events. A higher priority event can still send an email even if sending is blocked by a lower priority trigger. Remember, once an email is sent, there is a brief time before a second email can be sent, set by the setting no_sec_mail. So, this blocking mechanism is now governed by the priority scheme.

GPIO trigger

The csv file for the GPIO has the following structure.

Label Probability Move Area Delay Prolong Pin Inv

COCO labels

All detectable objects:

person bicycle car motorcycle airplane bus train truck boat traffic light
fire hydrant stop sign parking meter bench bird cat dog horse sheep cow
elephant bear zebra giraffe backpack umbrella handbag tie suitcase frisbee
skis snowboard sports ball kite baseball bat baseball glove skateboard surfboard tennis racket bottle
wine glass cup fork knife spoon bowl banana apple tennis racket bottle
broccoli carrot hot dog pizza donut cake chair couch potted plant bed
dining table toilet tv laptop mouse remote keyboard cell phone microwave oven
toaster sink refrigerator book clock vase scissors teddy bear hair drier toothbrush
Clone this wiki locally