Skip to content

ScionResearch/person-detector-recamera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Person Detector for reCamera

A Node-RED application for the Seeed Studio reCamera that detects people within user-defined polygon zones and drives GPIO outputs for alarms and a system heartbeat. Zones are configured live in the browser on top of the camera preview. Intended for industrial presence-detection use cases (e.g. guarding a hazardous machine) where traditional motion/IR sensors create too many false triggers.

Features

  • Live polygon zone editor over the camera preview (Zone 1 + Zone 2, drag-to-move vertices).
  • Real-time person-in-zone detection using the stock YOLO11n model.
  • Two independent alarm outputs on GPIO 487 (Zone 1) and GPIO 488 (Zone 2).
  • Heartbeat output on GPIO 490 (pulses while the detector loop is alive).
  • Single-page dashboard with live video, zone activity indicators, and save/reload controls.
  • Persistent zones stored in /home/recamera/zones.json.
  • Robust at full-frame-rate — preview pipeline runs at 30 fps / 1280×720, detection path is rate-limited to 3 msg/s to protect CPU.

Hardware

  • Seeed Studio reCamera (SG200X SoC).
  • reCamera PoE module (breaks out GPIO 487, 488, 490).
  • Outputs are 3.3 V sysfs GPIOs — for relays/external buzzers use an appropriate driver or opto-isolator.
GPIO Purpose
487 Zone 1 alarm output
488 Zone 2 alarm output
490 Heartbeat (1 Hz)

Prerequisites

  • reCamera on your network with default firmware (Node-RED + sscma-node + FlowFuse Dashboard preinstalled — these ship in stock).
  • Your workstation has ssh, scp, and either PowerShell (Windows) or bash (Linux/macOS).
  • You know the camera IP (e.g. 192.168.42.1) and the recamera user's password (default recamera; the user will prompt / you should change it).

Quick deploy

# Windows -- one-time SSH key install (avoids password prompts on every deploy)
./scripts/setup-ssh-key.ps1 -CameraIp 192.168.42.1

# Deploy
./scripts/deploy.ps1 -CameraIp 192.168.42.1
# Linux / macOS
./scripts/setup-ssh-key.sh 192.168.42.1
./scripts/deploy.sh 192.168.42.1

What deploy does (in a single SSH session):

  1. SCPs the flow JSON and recamera-setup.sh to /tmp/ on the camera.
  2. Runs the setup script with sudo — exports GPIO 487/488/490, sets direction, makes them writable by recamera, creates /home/recamera/zones.json if missing.
  3. Strips any pre-existing dashboard config nodes from the running flow (the factory image ships its own ui-base which conflicts with ours), merges in our flow, and POSTs the result to the Node-RED admin API.
  4. Verifies exactly one ui-base exists post-merge before deploying — aborts otherwise.

The dashboard then comes up at http://CAMERA_IP:1880/dashboard/ within a few seconds.

Using the dashboard

  1. Pick Edit Zone 1 (or Zone 2).
  2. Click in empty space on the preview to add polygon vertices (need 3+).
  3. Drag a vertex to move it.
  4. Click Finish to close the polygon.
  5. Click Save to write zones to disk and activate the detector.
  6. Click Reload to discard drafts and refetch the saved zones.

The red dot next to Zone 1 / Zone 2 lights while a person's bounding box intersects that zone; GPIO 487 / 488 tracks the dot state.

Repository layout

flow/person-zone-detection-flow.json   # Node-RED flow (single tab, single UI page)
scripts/deploy.ps1 / deploy.sh          # one-shot deploy from workstation
scripts/recamera-setup.sh               # on-device GPIO init (run by deploy)
docs/architecture.md                    # how the flow is wired
docs/troubleshooting.md                 # known issues / gotchas

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors