dyn-object-masks

Installation
SKILL.md

When to use

  • Detect moving objects in scenes with camera motion; produce sparse masks aligned to sampled frames.

Workflow

  1. Global alignment: warp previous gray frame to current using estimated affine/homography.
  2. Valid region: also warp an all-ones mask to get valid pixels, avoiding border fill.
  3. Difference + adaptive threshold: diff = abs(curr - warp_prev); on diff[valid] compute median + 3×MAD; use a reasonable minimum threshold to avoid triggering on noise.
  4. Morphology + area filter: open then close; keep connected components above a minimum area (tune as fraction of image area or a fixed pixel threshold).
  5. CSR encoding: for final bool mask
    • rows, cols = nonzero(mask)
    • indices = cols.astype(int32); data = ones(nnz, uint8)
    • counts = bincount(rows, minlength=H); indptr = cumsum(counts, prepend=0)
    • store as f_{i}_data/indices/indptr
Installs
1
GitHub Stars
1
First Seen
Jun 12, 2026
dyn-object-masks — tomevault-io/tomes