Skip to content

feat(video,calib3d): no_std support (Phase 3) - #89

Merged
kalwalt merged 3 commits into
feat/no_stdfrom
feat/no-std-phase3-eval
Aug 5, 2026
Merged

feat(video,calib3d): no_std support (Phase 3)#89
kalwalt merged 3 commits into
feat/no_stdfrom
feat/no-std-phase3-eval

Conversation

@kalwalt

@kalwalt kalwalt commented Aug 5, 2026

Copy link
Copy Markdown
Member

Concludes the exploratory Phase 3 (#85) with "port both" and implements it: video (optical flow) and calib3d (pose estimation, SVD) now compile under no_std + alloc.

Why port (the exploration result)

The audit found no hard blockers:

  • std usage was minimal — video had none, calib3d had 4 trivial std:: paths (f64::consts, cmp::Ordering).
  • calib3d RANSAC (solve_pnp_ransac, find_homography, find_fundamental_mat) uses its own self-contained Lcg PRNG (fixed-seed, pure arithmetic), not the std-gated thread-local RNG that forced hough_lines_p to stay std-only in Phase 2.
  • No HashMap, Instant, thread_local, or println in either module.
  • The empirical probe produced 137 errors, all mechanical — the exact Vec/vec!/to_string/Float/std::core::/format! classes as Phase 2.

Memory: calib3d's SVD runs on tiny matrices (trivial); video's optical-flow pyramids are heap-heavy but feasible at low resolution — documented as the one caveat.

Changes

  • Un-gate video + calib3d (module + prelude re-exports) in lib.rs.
  • Mechanical std::core::, alloc imports, and num_traits::Float where concrete f32/f64 math is used. optical_flow's SIMD-only vec! import is gated behind simd.
  • crates/no-std-smoke now also exercises rodrigues (calib3d) and build_optical_flow_pyramid (video), so the bare-metal build covers all four no_std modules.
  • CI no_std Build job renamed to cover core + imgproc + calib3d + video.
  • README: new "no_std / embedded support" section with a per-module support matrix (satisfies [no_std] Phase 3 (exploratory) — evaluate video/calib3d on embedded targets #85's documentation acceptance criterion).

Verification

  • --no-default-features builds clean on host and thumbv7em-none-eabihf.
  • 308 lib + 40 doc tests pass with default features; clippy/fmt clean on no-default / default / simd+parallel.
  • The no_std smoke crate builds for thumbv7em exercising all four modules; ESP32-S3 examples build against this tree.

After this, the whole core + imgproc + calib3d + video surface is no_std; only features2d remains std-gated.

Closes #85
Refs #82

🤖 Generated with Claude Code

kalwalt and others added 3 commits August 5, 2026 13:13
Phase 3 (#85) concluded the exploration with "port both": the audit found
no hard blockers — calib3d RANSAC uses its own self-contained LCG PRNG (not
the std-gated thread-local RNG), and neither module uses HashMap/Instant/
threads. Un-gates `video` and `calib3d` (and their prelude re-exports).

Refs #85

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanical std::->core:: conversion, alloc imports (vec/Vec/format/ToString),
and num_traits::Float where concrete f32/f64 math is used. optical_flow's
SIMD-only vec! import is gated behind the simd feature. No behavior change.

Refs #85

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds rodrigues (calib3d) and build_optical_flow_pyramid (video) to the
no_std smoke crate, extends the CI job name, and documents the per-module
no_std support matrix in the README.

Refs #85

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kalwalt kalwalt self-assigned this Aug 5, 2026
@kalwalt kalwalt added enhancement New feature or request rust-code rust Pull requests that update rust code video-module calib3d-module labels Aug 5, 2026
@kalwalt
kalwalt merged commit bc01bec into feat/no_std Aug 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

calib3d-module enhancement New feature or request rust Pull requests that update rust code rust-code video-module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant