Skip to content

Add --capture_only and a marimapper_reconstruct command - #93

Draft
gunicsba wants to merge 1 commit into
TheMariday:mainfrom
gunicsba:capture-only-reconstruct
Draft

gunicsba wants to merge 1 commit into
TheMariday:mainfrom
gunicsba:capture-only-reconstruct

Conversation

@gunicsba

@gunicsba gunicsba commented Oct 19, 2026 •

Copy link
Copy Markdown

Two small additions that go together: capture the scans first, build the 3D map later.

marimapper wled --server 192.168.1.50 --capture_only     # captures the 2D maps, nothing else
marimapper_reconstruct --dir path/to/scans                # builds led_map_3d.csv from them

--capture_only

Skips the live 3D reconstruction and the 3D window, so only the detector and the file writer run. That keeps capturing light (nothing else competes with the camera and the LEDs for the CPU) and means you can scan without waiting for a reconstruction after every view, and fix the setup if a scan went wrong before reconstructing anything.

marimapper_reconstruct

Reads the 2D scans in a folder and writes led_map_3d.csv there, doing what the scanner does while it captures: reconstruct, rescale, fill gaps, recenter and add normals. It needs at least two views and says so if it has fewer, and it fails with a clear message if the scans don't overlap enough to reconstruct anything. The options that decide how the map is built (--interpolation_max_fill, --interpolation_max_error, --camera_model) are shared with the scanner through add_reconstruction_args.

Also in this PR

The README now says that options must come after the backend name. marimapper --device 1 wled silently ignores --device: each backend sub command has its own copy of the camera and scanner options, and its defaults replace what was given before it. I lost some time to that, it might deserve a fix of its own.

Testing

reconstruct is checked against the same scans the existing reconstruction test uses, the command is run end to end writing the CSV, and it's checked to refuse a folder with fewer than 2 scans. flake8 is clean and the existing tests pass.

On real data: I ran marimapper_reconstruct on the ten 2D files saved by real three camera scans. It took about 4 seconds and gave 191 of 200 LEDs, the same as the live reconstruction did during those scans. (--capture_only itself is tested here only by running the CLI and the unit tests, I haven't scanned with it.)

This touches scanner.py and the README in the same places as two other pull requests, #91 (multi camera) and #92 (progress display). They're independent but whichever lands second needs a small rebase. All three merged together pass all 74 tests.

🤖 Generated with Claude Code

--capture_only captures the 2D maps without starting the live 3D reconstruction or the
3D window, which keeps capturing light and means the heavy dependencies aren't busy while
the LEDs and the camera are. The 3D map can then be built from the saved scans at any time
with the new marimapper_reconstruct command, which runs the same steps the scanner does
(reconstruct, rescale, fill gaps, recenter, add normals) and writes led_map_3d.csv.

The reconstruction options (--interpolation_max_fill, --interpolation_max_error and
--camera_model) move into add_reconstruction_args so both commands share them.

The README now also says that options must come after the backend name: anything written
before it (marimapper --device 1 wled) is replaced by the backend's defaults.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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