> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trurec.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Boundary crossing

> Get an alert when someone crosses a line you draw, such as a fence line, a doorway or the edge of a yard, in the direction you care about.

*Tell me when someone crosses a line, in the direction I care about.*

You draw a line on a camera's view and say which way across it matters. TruRec AI alerts you when a person crosses it that way, during the hours you choose.

## Good for

* A fence line or a site perimeter
* A doorway into a back-of-house area
* The edge of a yard, a loading dock or a car park
* A gate that should only be used one way

## Set it up

**1. Draw the boundary**

The line is required, because it's the whole point of the job. It starts on a suggested line on a still from the camera. Choose **Adjust the line** and drag each end to where people actually walk. Put it a little inside the real boundary, so a foot on the line doesn't count. See [Lines](https://docs.trurec.ai/use-cases/drawing-zones.md#lines).

A short line can't be crossed cleanly, so it needs to be at least about 5% of the view long. The app won't save a shorter one.

![A camera still of a gate in a wooden fence. An orange line runs across the gateway just inside the gate, and a white arrow labelled In points from the line into the yard. An Adjust the line button sits in the corner.](https://mintcdn.com/trurec-ai-public-docs/9VQKp94LpB0n4hkt/images/use-cases/boundary-line-yard-gate.png?fit=max\&auto=format\&n=9VQKp94LpB0n4hkt\&q=85\&s=cd3bd9c442ab7dceeb8e32b18c90962c)

A line across a yard gate, just inside it, with the arrow marked In pointing into the yard.

**2. Choose which direction matters**

**Coming in** means crossing the line the way the arrow on the frame points. Use **Flip direction** to turn the arrow round. **Going out** is the opposite way. **Either way** alerts on both.

Crossings in the other direction are still recorded as detections, but they don't send an alert.

**3. Choose what should count**

Choose **People**. Vehicle detection isn't available yet.

**4. Choose when it matters**

Choose **All day, every day** for a perimeter. Choose **Only during hours I set** if crossings are normal during opening times, and set the hours when they're not. Outside those hours, crossings are still recorded as detections, but they don't send an alert.

**5. Choose how urgent it is**

A perimeter crossing is usually urgent, so **Urgent** is the default: alerts are emailed to your alert list. For a busy gate in opening hours, **In-app only** keeps alerts in Alerts without emailing anyone, as long as none of your other boundary crossing jobs is **Urgent**. Urgency applies to all your boundary crossing jobs together. See [Choose who gets alerts](https://docs.trurec.ai/alerts/notification-routing.md).

## What you'll get

Each alert shows the camera and the time, usually with a short clip. Before you save, you'll see a summary, for example:

> On `yard-gate`, you'll be alerted when a person is coming in across the line you drew, all day, every day.

## How a crossing is counted

TruRec AI follows where a person's feet are, not their head or their hands. A crossing counts when the feet are clearly on one side of the line and then clearly on the other, and the person keeps walking the same way for about a second and a half. Turning back before then cancels it.

* Someone who steps over and straight back doesn't count. With **Either way**, the walk back can count as a crossing the other way, if they keep going.
* Someone standing on the line may not count at all.
* Someone walking along the line, or past the end of it, doesn't count. Only a path that goes through the line does.
* Someone leaning or reaching across the line doesn't count: their feet didn't cross.
* Once a person has set off an alert, the same person doesn't set off another for five minutes. Everyone else who crosses still sets off alerts, so a busy gate can send a lot. Set hours, or choose **In-app only**, for a gate people use all the time.
* The five minutes follow the person as TruRec AI tracks them. If someone is hidden for a moment, for example in a crowd, and then seen again, they can set off a second alert.

## Limits

* A line is stricter than an area. If you want to know about anyone who is in a place, not just how they got there, use [Restricted-area entry](https://docs.trurec.ai/use-cases/restricted-area-entry.md) instead.
* It can't tell you who someone is, or whether they were allowed through.
* It won't call anyone. Urgent alerts are emailed to your alert list.
* It only detects people. Vehicle detection isn't available yet.
* It can't see through glare or heavy rain, or past a camera that's been knocked out of position.
* **Not validated at night yet.** We haven't finished measuring how well it works. So far it's been tested on daytime indoor scenes. At night, on infrared, or on high-mounted cameras, expect more missed and wrong alerts.

## Tips

* **Draw the line on the ground,** across the path, not up a door or along a fence. The camera has to see feet cross it.
* **Draw it a little inside the real boundary,** so a foot on the fence line or the threshold doesn't count.
* **Pick a direction** rather than **Either way** when you can. One direction is the most reliable; **Either way** also alerts on everyone leaving.
* **Getting alerts during a shift?** Set hours, so normal working traffic through a gate doesn't alert.
* **Getting alerts for people who never crossed?** They're probably working right next to the line, for example bending down or pushing a trolley. Move the line a little further from where people stand.

See [Reduce false alerts](https://docs.trurec.ai/alerts/tuning-false-positives.md) for more.

> [!NOTE]
>
> **On Enterprise:** use cases are planned with you, so settings and limits can differ from this page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.