brokkr_reference: a reference view's camera solved from marked points (cut reference-camera) #35

Merged
eureka merged 7 commits from nibu/reference-camera into main 2026-12-02 19:07:57 +00:00
Owner

Cut aetheria-release:cut_spec:cut-reference-camera.r1 (rulings reference-fit-in-brokkr, reference-lens-band-bounded).

A new host add-on, surfaces/blender/brokkr_reference: the camera a reference view was drawn through, solved from points known in the world and marked on the image. Ported from round 9's experiments/mechs/camsolve.py (3f45b67). Only new files; nothing on main changes behaviour.

  • core.py (numpy and the standard library): solve, project, ray, lift, lm, blender, camera_of, in_frame, and the action's field parsers. The focal length is held to 4-4000 mm at the box's width; the record carries lens_band (an equal-error band, not a confidence interval) and lens_at_bound; square snaps the yaw to the nearest quarter turn; refusals are ReferenceError(ValueError) naming the cause.
  • brokkr_reference.solve_camera (one row in brokkr_actions.json): points in as text, the camera record out in hostResult; with camera_name a camera is created or updated there and the render size set to the box.
  • docs/reference.md, tests/test_reference.py (19 tests, no Blender), tests/live/reference.py with its result (14 checks, Blender 5.3.0).

Beyond the port, in core.py:

  • Place is solved as the camera's offset divided by f over the marks' extent, so log f alone is a dolly zoom, and a parameter held at a bound sits out of the LM step. With place in metres and a plain clamp, a noise-free orthographic view stopped at 3024 mm with a band of [2736, 3024]: the solve crawled along the distance-lens trade and the band's long end was the optimiser's, not the data's. It now reaches 4000 and says lens_at_bound: "long".
  • The band is walked to the first miss or the bound (camsolve stopped at 20 steps).
  • square took its final yaw from the last start, not the best one; it now reads it from the solved vector.
  • blender() returns a dict, and in_frame accounts for the frame's whole-pixel height.
  • solve(lens=...) holds the lens.

Verification: the unit suite passes (533 tests, 20 skipped); mutants M1 to M7 each die (M4 in SolveTests.setUpClass, by OverflowError); the live re-render's silhouette misses the first by 1 - IoU = 0.000168 (0.6489 with shift_y flipped).

Cost: test_reference.py takes 25 to 50 s (about 20 solves at 1 to 6 s each).

🤖 Generated with Claude Code

🤖 Generated with Claude Code

Cut `aetheria-release:cut_spec:cut-reference-camera.r1` (rulings `reference-fit-in-brokkr`, `reference-lens-band-bounded`). A new host add-on, `surfaces/blender/brokkr_reference`: the camera a reference view was drawn through, solved from points known in the world and marked on the image. Ported from round 9's `experiments/mechs/camsolve.py` (3f45b67). Only new files; nothing on main changes behaviour. - `core.py` (numpy and the standard library): `solve`, `project`, `ray`, `lift`, `lm`, `blender`, `camera_of`, `in_frame`, and the action's field parsers. The focal length is held to 4-4000 mm at the box's width; the record carries `lens_band` (an equal-error band, not a confidence interval) and `lens_at_bound`; `square` snaps the yaw to the nearest quarter turn; refusals are `ReferenceError(ValueError)` naming the cause. - `brokkr_reference.solve_camera` (one row in `brokkr_actions.json`): points in as text, the camera record out in `hostResult`; with `camera_name` a camera is created or updated there and the render size set to the box. - `docs/reference.md`, `tests/test_reference.py` (19 tests, no Blender), `tests/live/reference.py` with its result (14 checks, Blender 5.3.0). Beyond the port, in `core.py`: - Place is solved as the camera's offset divided by f over the marks' extent, so log f alone is a dolly zoom, and a parameter held at a bound sits out of the LM step. With place in metres and a plain clamp, a noise-free orthographic view stopped at 3024 mm with a band of [2736, 3024]: the solve crawled along the distance-lens trade and the band's long end was the optimiser's, not the data's. It now reaches 4000 and says `lens_at_bound: "long"`. - The band is walked to the first miss or the bound (camsolve stopped at 20 steps). - `square` took its final yaw from the last start, not the best one; it now reads it from the solved vector. - `blender()` returns a dict, and `in_frame` accounts for the frame's whole-pixel height. - `solve(lens=...)` holds the lens. Verification: the unit suite passes (533 tests, 20 skipped); mutants M1 to M7 each die (M4 in `SolveTests.setUpClass`, by OverflowError); the live re-render's silhouette misses the first by 1 - IoU = 0.000168 (0.6489 with `shift_y` flipped). Cost: `test_reference.py` takes 25 to 50 s (about 20 solves at 1 to 6 s each). 🤖 Generated with [Claude Code](https://claude.com/claude-code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Ported from round 9's experiments/mechs/camsolve.py (3f45b67). The focal length is
held to 4-4000 mm at the box's width; the record carries lens_band (an equal-error
band, walked to the first miss or the bound) and lens_at_bound; square snaps the yaw
to a quarter turn; solve refuses by ReferenceError naming the cause; camera_of reads
blender() back. Place is solved as a dolly-zoom offset so log f alone is the
distance-lens trade, and a parameter held at a bound sits out of the LM step.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Points go in as text (world, pixels, box, turned, pivot); with camera_name the
camera is created or updated at the record and the render size set to the box.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 - IoU of the two silhouettes 0.000168 (0.6489 with shift_y flipped); Blender 5.3.0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
solve() refuses, before any solve and by which they are: fewer than six different world
points or pixels, pixels on one line, world points on one line, and world points in one
plane unless the lens is held and the centre is not solved. A record that is not finite
is refused too. One pixel for every name was a bare ValueError and one world point a
record of NaN (finding degenerate-marks-not-refused).

test_a_wide_band_is_walked_to_its_end kills a walk capped at 20 steps (M13): 4000 mm
shipped, 1177 capped, bound 2170. The lm call count that claims M3 is a bound, 61,
between 34 and 109. ReferenceError, which shadowed the builtin, is ReferenceFitError.
The docstring says a band of [x, x] is narrower than one step, not an exact lens.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
eureka merged commit 92f6144196 into main 2026-12-02 19:07:57 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Brokkr!35
No description provided.