Motion, objects and masks
12 min Read in this browser
You will be able to
- Explain how motion decides where Frigate looks
- Mask a timestamp, the sky or trees without hiding people
- Find and remove the motion that keeps the Hub busy
- Choose what each camera tracks
Frigate doesn't run its object model on every frame of every camera: it would need far more power than a Hub has. It looks for motion first, and runs the model only where something moved. Getting motion right is what keeps detection quick, the Hub cool, and false alerts rare. This lesson covers motion, the two kinds of mask, and what each camera tracks.
Motion first
On every frame of the sub stream, Frigate compares the picture with the one before. Where pixels changed, it draws a box and asks the model what is in it. Anything that changes for no reason costs the Hub effort:
- a clock printed on the picture;
- trees, hedges and flags in the wind;
- the sky, with clouds and the sun moving;
- a road with traffic the customer doesn't care about, a highway above all: a car every second, all day;
- a TV or a screen in view, which never stops moving, and shows people;
- rain and snow on the lens, and insects at night.
Frigate's Debug view, in a camera's settings, shows the motion boxes live. Watch it for a minute: wherever boxes appear when nothing interesting happens, there is something to fix.
Fix the camera first, then mask
The best fix is the one that stops the motion at its source: turn the overlay off on the camera, turn the camera a little so the tree leaves the frame. Masks are for what's left.
Motion masks
A motion mask tells Frigate to ignore motion inside an area. You draw it on the camera's picture in Frigate's Settings, Masks / Zones.
Use one over:
- the timestamp, if the customer wants it kept on the picture;
- the sky, above the roofline;
- a tree or a hedge nobody walks through.
Mask only what moves for no reason. A motion mask doesn't stop Frigate tracking a person who walks into the area: it stops Frigate noticing someone who appears there. Mask the whole hedge along the path, and a person standing in front of it may never be detected.
Object masks
An object mask is different: it drops one kind of object detected in an area. Use it for something that is there and is detected wrongly, every time, in the same place: a statue read as a person, a car on the neighbour's drive the customer doesn't care about.
Frigate checks where the object's box touches the ground (the bottom of the box), so draw the mask where the object stands, not over all of it.
What saves the Hub, and what doesn't
Motion decides how often the model runs, so constant motion is constant work. A camera that sees a highway asks the model about every passing car, all day, even if it tracks only people: the model has to look before it knows there's no person. A few cameras like that and the Hub is overloaded, with Home Assistant slowed down alongside.
Only two things lower that load:
- Removing the motion: overlay off, camera turned.
- A motion mask over what's left. Frigate then doesn't look there at all.
Zones and object masks don't. The model still runs on everything that moves; they only decide what is kept afterwards: a zone, which objects make an alert; an object mask, which detections are dropped. They are the right tools for wrong alerts, the wrong ones for a busy Hub.
Three scenes that keep a Hub busy, and their fix:
| Scene | Why it costs | Fix |
|---|---|---|
| A highway or busy road in the background | A car moves through it every second | Motion mask over the road, if no one walks there; better, aim the camera lower |
| A TV or screen in a showroom or living room | Its picture moves all day, and the people on it get detected as people | Motion mask over the screen |
| The timestamp on the picture | The seconds change every second | Overlay off on the camera, or a motion mask over it |
Mask each one, then watch the Debug view again: an empty scene should show no motion boxes, and the Hub's load on the System page should fall back.
What each camera tracks
Selora AI adds cameras tracking people. Add others only where they're useful, since each object tracked adds alerts:
- car on a driveway camera. Frigate's model calls buses, vans and trucks "car" too.
- dog, cat in a garden, if the customer wants to know where the pets are.
Ask Selora AI, for example "Have the driveway camera look for cars too." It shows what the camera will start and stop looking for before it changes anything. The Detect switch on the camera in Home Assistant turns all detection on or off: it doesn't choose objects.
Frigate
The open-source recorder Selora runs on the Hub. It records the cameras and detects people, vehicles and animals in what they see, locally.
Sub stream
The camera's second, smaller stream of the same picture, such as 640×480 at 5 fps. Frigate detects on it, which costs a fraction of the main stream.
Motion mask
An area of a camera's picture where Frigate ignores motion, such as the clock or the sky. Mask only what moves for no reason, or people standing there go unnoticed.
Object mask
An area where Frigate drops one kind of object it detects, such as a statue it keeps reading as a person.
Go further on selorahomes.com
What you read is saved in this browser only. Sign in to keep it in your account, take the quizzes and get certified.
This lesson by Selora Homes is licensed CC BY 4.0 : share and adapt it, even commercially, crediting Selora Homes with a link. Photos by others keep their own licences, as credited.