SECUREXSECURITY ENGINEERINGNVR 文档

画面变动检测

运动检测是目标检测前的一层轻量筛选:先找出画面中发生变化的区域,再把相关区域送入目标检测流程。调得过敏会浪费算力,调得太钝则可能漏掉目标首次出现。

运动检测不等于目标检测

树叶、雨雪、阴影、时间戳叠字都可能产生运动,但它们不一定是 person/car。运动检测的任务是决定“哪里值得运行目标检测”,而不是判断对象类别。

示例

cameras:
  front:
    motion:
      threshold: 30
      contour_area: 10
      improve_contrast: true
      mask: 0.00,0.00,1.00,0.00,1.00,0.12,0.00,0.12

关键参数思路

  • threshold:像素变化达到多大程度才认为有运动。
  • contour_area:过滤过小的运动轮廓。
  • improve_contrast:低对比度场景可尝试,但会增加处理。
  • mask:遮掉持续运动或无意义区域,如树冠、道路远端、摄像头时间戳。

调试顺序

  1. 先关闭不必要的 mask,观察原始运动框。
  2. 如果满屏噪点,先处理压缩噪声/低照度,再适当提高 threshold。
  3. 如果树叶不断触发,使用 motion mask,而不是 object mask。
  4. 确认人进入画面时能够及时出现运动区域,再继续调目标过滤器。

不要过度遮罩

运动 mask 过大可能导致目标进入遮罩区域时完全没有触发检测。建议只遮持续无意义的画面变化,保留人员/车辆可能进入的路径。

Motion detection

Motion detection is a lightweight gate before object detection. It finds changing regions and lets the system spend inference work where something is happening. If it is too sensitive, compute is wasted; if it is too insensitive, the first appearance of an object may be missed.

Motion is not object detection

Leaves, rain, shadows, compression noise, and timestamp overlays can all create motion without being a person or vehicle. Motion answers “where should we analyze?”, not “what is it?”.

Example

cameras:
  front:
    motion:
      threshold: 30
      contour_area: 10
      improve_contrast: true
      mask: 0.00,0.00,1.00,0.00,1.00,0.12,0.00,0.12

Key tuning ideas

  • threshold controls how much pixel change is considered motion.
  • contour_area rejects tiny motion regions.
  • improve_contrast may help low-contrast scenes at additional processing cost.
  • mask excludes persistent irrelevant motion such as trees or timestamp overlays.

Tuning order

  1. Observe raw motion boxes first.
  2. Fix noisy/low-light video, then raise threshold only as needed.
  3. Use a motion mask for waving trees rather than an object mask.
  4. Confirm a person entering the scene reliably creates motion before tuning object filters.

Avoid over-masking

A large motion mask can prevent detection from ever starting when an object enters through the masked area. Mask only persistent irrelevant changes.

Detección de movimiento

La detección de movimiento es un filtro ligero antes de la detección de objetos. Localiza regiones que cambian para concentrar la inferencia allí. Una sensibilidad excesiva desperdicia recursos; una sensibilidad baja puede retrasar detecciones.

Movimiento no es detección de objetos

Hojas, lluvia, sombras, ruido y marcas de hora pueden generar movimiento sin ser una persona o vehículo.

Ejemplo

cameras:
  front:
    motion:
      threshold: 30
      contour_area: 10
      improve_contrast: true
      mask: 0.00,0.00,1.00,0.00,1.00,0.12,0.00,0.12

Parámetros clave

  • threshold define el cambio mínimo.
  • contour_area descarta regiones pequeñas.
  • improve_contrast puede ayudar con bajo contraste.
  • mask excluye zonas de movimiento irrelevante.

Orden de ajuste

  1. Observe las regiones de movimiento.
  2. Corrija ruido/iluminación y luego ajuste threshold.
  3. Use motion mask para árboles en movimiento.
  4. Compruebe que una persona activa movimiento antes de tocar filtros de objetos.

No enmascare demasiado

Una máscara de movimiento muy grande puede impedir que se inicie la detección cuando entra un objeto.

输入关键词开始搜索