Skip to content

Phase B3: pixel-extrapolation ghosts (EXTRAP / Path B) - #11

Closed
mandarwagh9 wants to merge 1 commit into
feat/phaseB-2-homographyfrom
feat/phaseB-3-extrapolation
Closed

mandarwagh9 wants to merge 1 commit into
feat/phaseB-2-homographyfrom
feat/phaseB-3-extrapolation

Conversation

@mandarwagh9

Copy link
Copy Markdown
Owner

What & why

Phase B3 — the third and final ghost-prediction path. When a camera loses a person it was previously tracking (but the world object is still alive via another camera), dead-reckon a red EXTRAP ghost from that camera's last-known pixel position along its pixel velocity, capped by an adaptive budget. All three ghost paths (green/orange/red) are now live.

⚠️ Stacked on the chain (#10 → … → #4). Auto-retargets as the stack merges.

Changes

  • World model — refined the prediction skip from "ever seen by this camera" to "seen within a live window" (~2 frames), so a camera that lost a target becomes eligible for a ghost. generate_predictions now tries Path A (homography) → Path B (extrapolation) → Path C (world projection).
  • _try_extrapolation_prediction — slides the last pixel by velocity × time × fps, capped at min(250, 80 + 40·t) px; zero-velocity stays put; no pixel history → None (falls through).
  • README — flipped EXTRAP / red ghost from 🔭 planned to ✅ implemented (status table, ghost-predictions row, AR-overlay table + paragraph, edge-case caveat). All three paths now documented as active.

Tests (TDD)

6 new in test_extrapolation.py: no-history → None, moves in velocity direction, displacement capped by budget, zero-velocity stays at last pixel, integration emits EXTRAPOLATION for a lost camera, and a live camera is skipped (no ghost).

Verification

  • ruff clean · mypy clean (17 files) · 95 tests pass (was 89).
  • Coverage 58% (floor 50%).

🤖 Generated with Claude Code

Phase B3 — the third and final ghost-prediction path. When a camera loses a
person it was previously tracking (but the world object is still alive via another
camera), dead-reckon a red EXTRAP ghost from this camera's last-known pixel
position along its pixel velocity, capped by an adaptive budget.

- world model: refine the prediction skip from "ever seen by this camera" to
  "seen within a live window" (~2 frames), so a camera that LOST a target becomes
  eligible for a ghost. generate_predictions now tries Path A (homography) ->
  Path B (extrapolation) -> Path C (world projection).
- _try_extrapolation_prediction: slide last pixel by velocity * time * fps, capped
  at min(250, 80 + 40*t) px; zero-velocity stays put; no pixel history -> None.
- README: flip EXTRAP / red ghost from planned to implemented; all 3 paths now active.
- Tests: 6 new (no-history None, moves in velocity direction, budget cap,
  zero-velocity stays, integration emits EXTRAP for a lost camera, live camera skipped).

Coverage 58%. ruff/mypy clean, 95 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mandarwagh9

Copy link
Copy Markdown
Owner Author

Superseded — all commits from this phase landed on main via the merge of #13 (the top of the stack, which contains every phase commit). Closing to tidy up; the work is fully merged.

@mandarwagh9
mandarwagh9 deleted the feat/phaseB-3-extrapolation branch June 19, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant