Skip to main content

Overview

Image mode captures a single JPEG snapshot each time a person enters the camera frame. The snapshot is annotated with bounding boxes and confidence scores, making it ideal for entry logging, visitor tracking, and event-based monitoring.

How It Works

When running in image mode (--save image):
  1. Detection: The system analyzes every Nth frame (configurable via frame_skip) for person presence
  2. Entry Detection: When a person is first detected after being absent, an “entry event” is triggered
  3. Snapshot Capture: An annotated JPEG is saved immediately with:
    • Green bounding boxes around detected persons
    • Confidence scores for each detection
    • Sequential entry numbering
  4. Waiting State: The system continues monitoring but won’t save another snapshot until the person exits and re-enters
Image mode saves one snapshot per entry event, not one per frame. This prevents hundreds of duplicate images when a person remains in frame.

Basic Usage

Output:

Output Files

File Naming Convention

Single Stream:
Example: person_entry_1_20260309_143022_1741528222.jpg Multiple Streams:
Example: output/stream_1/person_entry_1_20260309_143022_1741528222.jpg

File Structure

Use Cases

1

Visitor Entry Logging

Monitor building entrances and capture a photo each time someone enters:
Higher thresholds reduce false positives from distant or partial detections.
2

Multi-Zone Surveillance

Monitor multiple areas simultaneously with live preview:
Press ‘q’ in the grid window to stop all streams.
3

Low-Storage Monitoring

Minimize disk usage by capturing only entry events:
Process fewer frames (frame-skip 30) and disable display for headless operation.
4

High-Precision Detection

Reduce false positives with stricter thresholds:
Only captures large, high-confidence detections.

Customizing Detection Thresholds

Confidence Threshold

Controls the minimum detection confidence score (0.0 to 1.0):
Lower values (0.3-0.4): More detections, more false positives
Default (0.5): Balanced accuracy
Higher values (0.7-0.8): Fewer false positives, may miss some persons

Area Threshold

Controls the minimum bounding box area in pixels:
Recommended values:
  • Close-range cameras (< 5 meters): 2000-5000 pixels
  • Medium-range cameras (5-15 meters): 1000-2000 pixels
  • Long-range cameras (> 15 meters): 500-1000 pixels

Frame Skip

Controls how many frames to skip between detections:
Lower frame-skip values increase CPU/GPU usage but detect entries faster. Higher values reduce resource usage but may miss brief appearances.

Advanced Configuration

Using a Custom Config File

Create custom.cfg:
Run:

Override Config Values

Command-line flags always take precedence over config file values:

Troubleshooting

Increase detection thresholds:
Lower thresholds or reduce frame skip:
This is expected behavior. Each time a person exits and re-enters the frame, a new snapshot is saved. If a person remains continuously in frame, only one snapshot is captured at entry.
Check:
  • Output directory permissions
  • Detection thresholds (try lowering --confidence)
  • Use --test-image to verify detection works

Video Mode

Capture MP4 clips of entire presence duration

Test Image

Test detection with a local image file