Skip to content

feat: no_std / embedded support for core, imgproc, calib3d & video (#82) - #90

Merged
kalwalt merged 14 commits into
devfrom
feat/no_std
Aug 7, 2026
Merged

feat: no_std / embedded support for core, imgproc, calib3d & video (#82)#90
kalwalt merged 14 commits into
devfrom
feat/no_std

Conversation

@kalwalt

@kalwalt kalwalt commented Aug 5, 2026

Copy link
Copy Markdown
Member

Promotes the completed no_std / embedded work from the feat/no_std integration branch into dev. This is the umbrella #82 effort, delivered in three phases (each already reviewed and merged into feat/no_std):

What's included

  • core, imgproc, calib3d, and video all compile with --no-default-features (only core + alloc). features2d remains std-gated.
  • parallel, simd, fft, and ndarray imply std; disabling default features gives the scalar, single-threaded paths.
  • A build-only crates/no-std-smoke consumer + a CI job building the library and the smoke crate for thumbv7em-none-eabihf.
  • README: new "no_std / embedded support" section with a per-module support matrix and quickstart, MSRV note, version fixes (0.5 → 0.6), and roadmap update.

Verification

  • --no-default-features builds clean on host and thumbv7em-none-eabihf.
  • Full suite green with default features (308 unit + 40 doc tests); clippy/fmt clean on no-default / default / simd+parallel.
  • Verified on real ESP32-S3 hardware via webarkit/purecv-esp32-examples (matrix arithmetic, Gaussian blur, and solve_pnp pose estimation).

Closes #82
Closes #83
Closes #84
Closes #85

🤖 Generated with Claude Code

kalwalt and others added 14 commits July 13, 2026 16:39
num-traits switches to libm-backed float math so core compiles without
the standard library; parallel/simd/fft/ndarray require std until their
own no_std phases land (#82). Default features are unchanged.

Refs #83

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- add #![cfg_attr(not(feature = "std"), no_std)] and extern crate alloc
- std-gate the not-yet-converted modules (calib3d, features, features2d,
  imgproc, video) and their prelude re-exports
- switch std:: paths to core::/alloc:: throughout src/core
- PureCvError now implements core::error::Error (MSRV 1.88)
- float methods resolve through num_traits::Float (libm) in no_std builds
- std-gate get_tick_count/get_tick_frequency (no bare-metal clock) and the
  thread-local RNG API; replace a debug eprintln! with log::warn!

Verified on thumbv7em-none-eabihf and ESP32-S3 (Xtensa).

Refs #83

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
crates/no-std-smoke consumes the purecv public API from a #![no_std]
crate; building it for a bare-metal target proves downstream no_std
usability. Excluded from the workspace as its own root.

Refs #83

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Builds and lints with --no-default-features on the host, then builds
purecv and the smoke-test consumer for thumbv7em-none-eabihf.

Refs #83

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
default-features = false previously only dropped rayon; now that std
gates the non-core modules, the wasm wrapper must opt back into it.

Refs #83

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts:
#	src/core/arithm.rs
#	src/core/dynamic.rs
#	src/core/matrix.rs
#	src/core/metrics.rs
#	src/core/rng.rs
#	src/core/structural.rs
feat(core): no_std support for the core module (Phase 1)
Un-gates `imgproc` (and its prelude re-exports) for no_std builds; the
module now compiles with only core + alloc.

Refs #84

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Converts std:: paths to their core:: equivalents and adds alloc imports
(vec/Vec/format/ToString) plus num_traits::Float where concrete f32/f64
math is used, so scalar fallbacks build without std. No behavior change.

Refs #84

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a scalar gaussian_blur call to the bare-metal smoke consumer and
updates the CI job name to cover Phase 2 (issue #84).

Refs #84

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
- broaden the intro/philosophy to cover all modules and no_std targets
- add an "Embedded-ready" philosophy bullet and a no_std quickstart snippet
- note MSRV 1.88; fix version examples (0.5 -> 0.6)
- core::f64::consts (available under no_std), updated test counts (308/40)
- roadmap: mark embedded/no_std support done

Refs #82

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kalwalt kalwalt self-assigned this Aug 5, 2026
@kalwalt
kalwalt merged commit e6883ef into dev Aug 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant