区域(Zones)
Zone 用于定义“有业务意义的空间”,例如前门、车道、停车位、收银区。Securex NVR 根据跟踪目标边界框的底部中心点判断目标是否位于区域内,所以绘制区域时应覆盖脚/车轮实际经过的位置,而不是只覆盖身体上半部分。
创建与命名
- Settings → Camera configuration → Masks / Zones。
- 选择摄像头,新建 Zone 并在当前画面点击顶点闭合多边形。
- 使用稳定标识,例如
front_door、driveway。 - 按需要限制 Objects,并设置 Loitering/Inertia 等行为参数。
- 保存后在 Debug 中打开 Zones 显示进行验证。
基础 YAML
cameras:
front:
zones:
driveway:
friendly_name: Driveway
coordinates: "0.06,0.96,0.94,0.96,0.80,0.55,0.22,0.55"
objects:
- person
- car
required_zones
如果你只希望“进入区域后”才生成 Review Alert、保存快照或触发下游逻辑,应把 Zone 作为 required zone,而不是通过大面积 mask 去排除画面其他区域。
cameras:
front:
review:
alerts:
required_zones:
- driveway
snapshots:
required_zones:
- driveway
Loitering 与 Inertia
Loitering 用于要求目标在区域内停留一定时间后才满足条件;Inertia 可减少目标在边界附近抖动造成的“进/出区域”状态频繁变化。具体值应结合 FPS、镜头角度和目标速度测试。
多摄像头同一区域
多台摄像头可以使用相同的逻辑 Zone 名称,表示同一个物理区域,但每台摄像头的坐标都必须独立绘制。不要把 Zone 名称设成与 Camera 名称相同。
调试
| 现象 | 原因/处理 |
|---|---|
| 目标框已经重叠但没进入 | 看底部中心点是否进入,不是看矩形是否相交 |
| 边缘频繁进出 | 调整多边形、Inertia,避免边界卡在主要行进线上 |
| 同类事件太多 | 限制 objects,再在 Review/通知中使用 required_zones |
| 改分辨率后偏移 | 在当前 detect 图像重新绘制并保存 |
Zones
Zones define meaningful spaces such as a front door, driveway, parking bay, or checkout area. Zone membership is based on the bottom-center point of the tracked bounding box, so draw the polygon where feet or wheels actually travel.
Create and name a zone
- Open Settings → Camera configuration → Masks / Zones.
- Create a zone and close the polygon on the camera image.
- Use stable identifiers such as
front_doorordriveway. - Restrict object labels and tune loitering/inertia when needed.
- Enable Zones in Debug to verify behavior.
Basic YAML
cameras:
front:
zones:
driveway:
friendly_name: Driveway
coordinates: "0.06,0.96,0.94,0.96,0.80,0.55,0.22,0.55"
objects: [person, car]required_zones
If an alert, snapshot, or downstream action should occur only after an object enters an area of interest, use the zone as a required zone instead of hiding most of the frame with masks.
cameras:
front:
review:
alerts:
required_zones: [driveway]
snapshots:
required_zones: [driveway]Loitering and inertia
Loitering can require an object to remain in the zone for a duration, while inertia helps reduce rapid enter/exit state changes near a boundary. Tune values against real movement in that camera.
Multiple cameras
Several cameras may reuse the same logical zone name for one physical area, but each camera needs its own polygon. Do not give a zone the same name as a camera.
Troubleshooting
| Symptom | Action |
|---|---|
| Box overlaps but no zone entry | Check the bottom-center anchor, not rectangle overlap |
| Rapid boundary toggling | Adjust geometry/inertia and avoid placing the border on the main path |
| Too many events | Restrict objects and use required_zones in Review/notifications |
| Offset after resolution change | Redraw against the current detect image |
Zonas
Las zonas definen espacios con significado: puerta, driveway, plaza o caja. La pertenencia se calcula con el punto central inferior del cuadro del objeto, por lo que el polígono debe cubrir el recorrido real de pies o ruedas.
Crear y nombrar
- Abra Settings → Camera configuration → Masks / Zones.
- Cree y cierre el polígono.
- Use nombres estables como
front_doorodriveway. - Limite objetos y ajuste loitering/inertia si es necesario.
- Active Zones en Debug.
YAML básico
cameras:
front:
zones:
driveway:
friendly_name: Driveway
coordinates: "0.06,0.96,0.94,0.96,0.80,0.55,0.22,0.55"
objects: [person, car]required_zones
Para crear alertas o snapshots solo después de entrar en una zona, use required_zones en lugar de enmascarar casi toda la imagen.
cameras:
front:
review:
alerts:
required_zones: [driveway]
snapshots:
required_zones: [driveway]Loitering e inertia
Loitering exige permanencia; inertia ayuda a evitar cambios rápidos en los bordes. Ajuste con movimiento real.
Varias cámaras
Puede reutilizar el nombre lógico en varias cámaras, pero cada una necesita sus propias coordenadas.
Problemas comunes
| Síntoma | Acción |
|---|---|
| La caja se solapa pero no entra | Revise el punto central inferior |
| Cambios rápidos en el borde | Ajuste geometría/inertia |
| Demasiados eventos | Restrinja objetos y use required_zones |
| Desplazamiento tras cambiar resolución | Redibuje la zona |
