Skip to content

feat: add OBB rectangle visualization to 2D Canvas demo - #12

Merged
YoshiRi merged 2 commits into
mainfrom
claude/review-repository-status-1GXDH
May 6, 2026
Merged

feat: add OBB rectangle visualization to 2D Canvas demo#12
YoshiRi merged 2 commits into
mainfrom
claude/review-repository-status-1GXDH

Conversation

@YoshiRi

@YoshiRi YoshiRi commented May 6, 2026

Copy link
Copy Markdown
Owner

実装したもの(設計書 docs/design/rectangle_visualization.md に準拠):
src/tracking/evaluation/interactive.py
LocalTracker クラス: ハンガリアン法でフレーム間トラック ID を管理し、ExponentialSmoother (alpha=0.4) で OBB をスムージング
_match_clusters_to_estimates(): セントロイド距離の linear_sum_assignment(ゲート 6.0 m)
_obb_to_dict(): OBBResult → {"cx","cy","theta","l","w","corners"} dict
run_once(record_frames=True) パスで clusters・obb をスナップショットに記録
docs/demo.html
クラスタ点群の色分け描画(6色パレット、データなし時は黄色にフォールバック)
drawOBB() で推定 OBB を橙色矩形として描画(コーナー座標を直接使用)
凡例に OBB エントリを追加
tests/tracking/test_interactive.py
TestOBBFrameSnapshot クラスに設計書指定の 6 テストを追加(全 41 件パス)

claude added 2 commits May 6, 2026 04:04
Design spec for adding OBB estimation results to the 2D Canvas demo:
- LocalTracker (Hungarian matching + ExponentialSmoother per track)
- _match_clusters_to_estimates (linear_sum_assignment, gate 6.0m)
- _obb_to_dict JSON schema (cx, cy, theta, l, w, corners)
- Updated frame snapshot schema with clusters + obb fields
- Canvas 8-layer drawing order and legend spec
- 6 test cases for OBB structure validation

https://claude.ai/code/session_013sQREGvTmjgFT8cyRNmPUL
Implements docs/design/rectangle_visualization.md:

- interactive.py:
  - LocalTracker: Hungarian-based frame-to-frame ID management with
    per-track ExponentialSmoother (gate 5.0m, alpha 0.4)
  - _match_clusters_to_estimates(): linear_sum_assignment centroid
    matching with 6.0m gate
  - _obb_to_dict(): OBBResult → JSON-serializable dict (cx, cy, theta,
    l, w, corners)
  - run_once() record_frames=True path now includes clusters and obb
    in each frame snapshot

- demo.html:
  - Cluster-colored point rendering (6-color palette, falls back to
    yellow when no cluster data)
  - drawOBB() draws fitted OBB as orange rectangle using corner coords
  - Updated legend with OBB entry

- test_interactive.py:
  - TestOBBFrameSnapshot with 6 tests covering clusters structure,
    obb key presence, 4-corner constraint, positive dimensions,
    centre proximity, and missed-frame null guarantee

https://claude.ai/code/session_013sQREGvTmjgFT8cyRNmPUL
@YoshiRi
YoshiRi force-pushed the claude/review-repository-status-1GXDH branch from 71dd67f to 7cfcfd6 Compare May 6, 2026 04:05
@YoshiRi
YoshiRi merged commit fb322f6 into main May 6, 2026
3 of 5 checks passed
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.

2 participants