Key points
- Use a zone when anyone present in an area is a problem. Use a line when only movement across a boundary, in one direction, matters.
- Draw zones on the ground where people walk, set back from the street, trees and reflective surfaces.
- Two layers, an outer line and an inner zone, give early warning and confirmation.
- Arm perimeter rules from the alarm panel or access control, not just a fixed clock schedule.
Perimeter protection is the most common reason businesses buy AI analytics. A car lot, equipment yard or loading area that should be empty at night is an ideal job for a camera that can tell people from foxes. The software does the classification; the quality of the result depends on how the rules are drawn.
Zones, lines and loitering
| Rule type | Triggers when | Good for |
|---|---|---|
| Intrusion zone | A classified object enters or is present inside a drawn area | Yards, roofs, compounds that should be empty |
| Line crossing | An object crosses a drawn line, optionally in one direction only | Fence lines, gates, driveways with two-way traffic |
| Loitering | An object stays in an area longer than a set time | Entrances, ATMs, back doors, stairwells |
| Crowding / occupancy | More than a set number of objects in an area | Lobbies, queues, smoking areas |
An example yard layout
The same approach works for rooftops, compounds and car lots: identify where a person has no reason to be at night, find the line they must cross to get there, then cover both with cameras that see them at a useful size.
In this layout, each camera sits on the building and looks out along the yard rather than straight at the fence. That keeps people in view for longer, at a useful size, and keeps headlights on the street out of the frame.
Drawing good zones
- Draw on the ground plane. The analytic usually checks where the bottom of the object's box sits, that is, the feet or tyres. Draw the zone where feet would be, not where heads would be.
- Set back from the boundary. Keep the zone a couple of metres inside the fence so people walking the public sidewalk do not trigger it.
- Mask, do not dodge. Use exclusion masks for trees, flags, reflective windows and roads. A tidy rectangle plus masks is easier to maintain than a twenty-point polygon.
- Respect pixel targets. Do not extend a zone beyond where a person is still large enough to classify. See placing cameras for analytics.
- Add a short dwell time. Requiring an object to be present for a second or two removes single-frame blips without missing real intruders.
Drawing good lines
- Place lines where the camera sees the full body crossing, not at the very edge of the image.
- Set the direction. Inbound across a fence matters; staff walking out to their cars does not.
- Keep the line a little inside a physical barrier, so climbing over it counts but leaning on it does not.
- For long fences, use several short lines from different cameras rather than one long line on a distant view.
- For vehicle gates, combine a line with a vehicle-only class so pedestrians using the man-gate are counted separately.
When rules should be armed
Fixed clock schedules break down when people work late, deliveries arrive early or holidays change the routine. The most reliable approach ties the analytics to the building's real state.
Most VMS platforms and many cameras can take an input from an alarm panel output or an access control event to switch rule profiles. We cover the wiring and software options in integrating analytics with alarms and access control.
Common mistakes we fix on existing sites
- Whole-image zones. A zone covering the entire frame includes the sky, the road and the neighbour's lot. It guarantees false alerts.
- Lines at the image edge. People appear already halfway across and the crossing is never seen as a full event.
- Bi-directional lines on two-way routes. Staff leaving trigger the same alert as intruders arriving.
- No owner for the alert. Rules sending to a shared mailbox that nobody checks overnight give a false sense of protection.
- Zones drawn by day only. At night, IR range may not reach the far end of the zone at all. Check the zone in the dark.
An outer line gives early warning; an inner zone confirms the person kept going. Sending only the confirmed event to a monitoring centre, with the line event attached as context, gives operators fewer, better alerts.
Snow banks, stacked pallets and parked trailers move the ground plane and hide feet. After a major change in the yard, re-check zones and re-run a walk test.