Calls and email answered 24/7/365 · An HSM Company contact@hsmservices.ca 1 800 716 8955

AI Cameras guide

Intrusion zones and line crossing: designing a perimeter

How to lay out zones, tripwires and schedules so an empty yard at night tells you only what matters.

  • Intermediate
  • 5 min read
  • Includes diagram

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 typeTriggers whenGood for
Intrusion zoneA classified object enters or is present inside a drawn areaYards, roofs, compounds that should be empty
Line crossingAn object crosses a drawn line, optionally in one direction onlyFence lines, gates, driveways with two-way traffic
LoiteringAn object stays in an area longer than a set timeEntrances, ATMs, back doors, stairwells
Crowding / occupancyMore than a set number of objects in an areaLobbies, queues, smoking areas

An example yard layout

Yard perimeter: line plus zone Street (masked out) Fence Building Intrusion zone person or vehicle, armed after hours Line crossing: inbound only Tree mask Cam 1 Cam 2 Gate
Diagram The red line warns as someone comes over or through the fence, the zone confirms they are inside, and masks remove the street and a moving tree.

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

  1. 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.
  2. 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.
  3. 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.
  4. Respect pixel targets. Do not extend a zone beyond where a person is still large enough to classify. See placing cameras for analytics.
  5. 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.

Arming follows the alarm panel, not the clock 00:00 06:00 12:00 18:00 24:00 Armed Disarmed: staff on site Armed 05:10 first badge + alarm off 19:40 alarm set by last person out
Diagram Linking analytics to the alarm or access system arms the perimeter when the site is actually empty, whatever time that happens.

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.
Two layers beat one

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.

Watch out

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.

Want a professional to handle it?

Our technicians install and certify ai cameras for businesses of every size. Send us the details and we will come back with a plan.