Skip to content

Phase B2: cross-camera homography ghost predictions (H-PROJ / Path A) - #10

Closed
mandarwagh9 wants to merge 1 commit into
feat/phaseB-1-appearance-reidfrom
feat/phaseB-2-homography
Closed

mandarwagh9 wants to merge 1 commit into
feat/phaseB-1-appearance-reidfrom
feat/phaseB-2-homography

Conversation

@mandarwagh9

Copy link
Copy Markdown
Owner

What & why

Phase B2 — the headline feature of the 10× roadmap. Implements cross-camera homography ghost prediction: when one camera sees a person and another doesn't, project the foot point between views to render a green H-PROJ ghost. Previously this was entirely absent (no cv2.findHomography in the pipeline).

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

Changes

  • New app/infrastructure/homography.pyHomographyEstimator: accumulates foot-point correspondences per camera pair, estimates H via cv2.findHomography + RANSAC once ≥ min_pairs, re-estimates periodically, projects points, and caps the pair buffer (keeps most-recent).
  • World-model integration:
    • store per-camera foot points on WorldObject (camera_foot_points)
    • _collect_correspondences feeds the estimator from objects co-visible on a tick
    • generate_predictions now tries Path A (homography → HOMOGRAPHY) first, falling back to Path C (world projection → WORLD) when no homography exists for the pair
    • wired from the existing HOMOGRAPHY_* Settings
  • README — flipped homography / H-PROJ from 🔭 planned to ✅ implemented (status table, feature rows, AR-overlay table, the deep-dive section header, and the edge-case caveat).

Tests (TDD)

8 new in test_homography.py:

  • estimator: recovers a known ground-truth H (sub-pixel), identity, directional independence, no-H-until-min-pairs, buffer cap, same-camera ignored
  • integration: generate_predictions emits HOMOGRAPHY when a homography + foot point exist; _collect_correspondences feeds the estimator for a co-visible object

Verification

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

🤖 Generated with Claude Code

Phase B2. Implements the headline cross-camera homography feature: when one camera
sees a person and another doesn't, project the foot point between views to render a
green H-PROJ ghost.

- New app/infrastructure/homography.py: HomographyEstimator accumulates foot-point
  correspondences per camera pair, estimates H via cv2.findHomography + RANSAC once
  >= min_pairs, re-estimates periodically, projects points, caps the pair buffer.
- World model integration:
  - store per-camera foot points on WorldObject (camera_foot_points)
  - collect correspondences from objects co-visible on a tick (_collect_correspondences)
  - generate_predictions tries Path A (homography, HOMOGRAPHY method) first, falling
    back to Path C (world projection) when no homography exists
  - wired from the existing HOMOGRAPHY_* Settings
- README: flip homography / H-PROJ from planned to implemented.
- Tests: 8 new (estimator: known-H recovery, identity, directionality, min-pairs,
  buffer cap, same-cam ignore; integration: predictions emit HOMOGRAPHY, correspondence
  collection for co-visible objects).

Coverage 55%->58%. ruff/mypy clean, 89 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-2-homography 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