feat(viewer): colour cameras by in_view coverage and draw seeing rays - #105
Open
dchaudhari7177 wants to merge 1 commit into
Open
feat(viewer): colour cameras by in_view coverage and draw seeing rays#105dchaudhari7177 wants to merge 1 commit into
dchaudhari7177 wants to merge 1 commit into
Conversation
The 3D viewer drew every camera the same crimson, so a scene's coverage — which camera holds the object on a given frame, and where two cameras overlap — was invisible in the rendered figure. Colour each camera's centre, label and frustum by whether it sees the object on the selected frame (green = sees, grey = blind), draw a light dotted ray from every seeing camera to the point it sees so overlap reads directly, and add a legend plus an "n/m cameras see the object" count to the title. Coverage is read straight off the manifest's per-camera `in_view` flags via the new `_coverage_at_frame` helper; the viewer does no reprojection of its own. A new `--frame` flag chooses the frame and rejects one that is not in the manifest, naming the available range. On `handoff_ltr` this reproduces the coverage pattern its test documents: LEFT green at frame 0 and grey by 39, RIGHT the reverse, WIDE green throughout, and a LEFT/MID_RIGHT overlap band in between.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #89.
What
The 3D viewer drew every camera the same crimson, so coverage — which camera holds the object on a given frame, and where two cameras overlap — was invisible in the rendered figure.
n/m cameras see the objectcount in the title.--frameflag selects the frame (defaults to the manifest's first). An out-of-range value is rejected with the available range named.Coverage comes from the new
_coverage_at_framehelper, which reads the manifest's per-camerain_viewflags directly — the viewer does no reprojection of its own, per the acceptance criteria.Acceptance check on
handoff_ltrLEFT green early and grey late, RIGHT the reverse, WIDE green throughout, with a LEFT/MID_RIGHT overlap band in between — matching the pattern
tests/test_handoff_ltr.pydocuments.Tests
tests/test_view_scene_3d.py(new, 7 tests) pins: frame enumeration, WIDE seeing every frame, the LEFT/RIGHT swap across the handoff, an overlap frame with both right-hand cameras, rays carrying the point they see, a PNG actually being written, and — most importantly — that reported coverage equals the manifest'sin_viewset exactly, which is what stops a future reprojection creeping in.All 7 fail on
mainwith the production file reverted, and pass with it.Checks run locally
ruff check .ruff format --check .mypy srcpytestTwo notes on the local run, both environment-side and unrelated to this change:
test_dsl_breadth,test_dsl_scene,test_mtmc,test_rig_heights,test_smoke) importmulticam_occlusion, which isn't in this repo, so I ignored them locally. CI's business, not this PR's.test_overlay.py::test_importing_package_does_not_import_pillowfails on pristinemainon my machine once Pillow is installed (I installedmatplotlibto exerciserender, and it pulls Pillow in). It asserts"PIL" not in sys.modulesglobally, so it's order-dependent on whether anything earlier in the session imported PIL — it passes in isolation. Pre-existing, flagged in case it's news.