Motion Detection Tuning

Overview

Motion detection must reliably detect jumpers while ignoring environmental changes (wind, lighting, snow). Tuning involves balancing sensitivity against false triggers.

Tuning Strategy

  1. Start with defaults — the sample settings work for typical conditions
  2. Enable debug output — set debug_motion=1 to see detection diagnostics
  3. Test with file playback — use the file player for repeatable testing
  4. Adjust one parameter at a time — change, test, evaluate

Motion Regions

The most effective tuning step is narrowing the motion region to exclude areas where non-jumper motion occurs (trees, spectators, wind-blown objects).

# Only monitor the landing hill area in feed 1
motion_start_x[1]=200
motion_start_y[1]=100
motion_end_x[1]=1700
motion_end_y[1]=900

Use the viewer with showing_motion=1 to visualize what the detector sees.

Threshold Tuning

Per-Pixel Thresholds

These control what counts as a "changed" pixel between frames:

Frame-Level Thresholds

These filter out whole-frame changes (lighting shifts, camera shake):

Tip: If the system triggers on clouds passing over the hill, lower max_diff_y%. If it misses jumpers in low contrast conditions, lower ydiff_min.

Blob Detection Tuning

Blob Size

Blob Merging

Nearby blobs are merged into one. Adjust merge tolerance:

Blob Movement

Trigger Tuning

Sustained Motion Count

The trigger requires multiple consecutive frames of motion to fire:

Neighbor Filter

Common Scenarios

ProblemAdjustment
False triggers on wind/treesNarrow motion_start/end to exclude trees. Increase min_blob_sizes.
False triggers on lighting changesLower max_diff_y% (e.g., 0.3). Increase min_blob_sizes.
Misses jumpers in fog/flat lightLower ydiff_min (e.g., 5). Lower min_blob_sizes (e.g., 15).
Clips end too earlyIncrease min_nomotion_count (e.g., 20).
Clips start too lateDecrease min_motion_count (e.g., 2). Increase movie_pad.
Too many small noise blobsIncrease min_blob_neighbors (e.g., 3). Increase min_blob_sizes.
Jumper splits into multiple blobsIncrease blob_fuzz_x and blob_fuzz_y (e.g., 50).
Triggers on spectatorsNarrow motion region to exclude spectator areas.

Debug Output

Enable diagnostics to see what the detector is doing:

debug_motion=1
debug_distance=1

This prints per-frame information to the console:

See Also