feat: no_std / embedded support for core, imgproc, calib3d & video (#82) - #90
Merged
Conversation
- 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>
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>
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.
Promotes the completed
no_std/ embedded work from thefeat/no_stdintegration branch intodev. This is the umbrella #82 effort, delivered in three phases (each already reviewed and merged intofeat/no_std):core([no_std] Phase 1 — makepurecv-corecompile underno_std + alloc#83):#![cfg_attr(not(feature = "std"), no_std)]+alloc; libm-backed float math vianum-traits; std-only APIs (thread-local RNG, tick counters) feature-gated; MSRV 1.88. Also brings in the OpenCV-style logging facility (feat(core): add OpenCV-style logging facade (cv::utils::loggingequivalent) #80) with the$crate::__format!fix socv_bail!/cv_err!work underno_std.imgproc([no_std] Phase 2 —purecv-imgprocunderno_std(parallel & simd disabled) #84): scalar fallbacks underno_std;hough_lines_pgated behindstd(thread-local RNG); everything else portable.video+calib3d([no_std] Phase 3 (exploratory) — evaluate video/calib3d on embedded targets #85): both fullyno_std— calib3d RANSAC uses its own self-contained LCG PRNG, so no std-only blockers.What's included
core,imgproc,calib3d, andvideoall compile with--no-default-features(onlycore+alloc).features2dremainsstd-gated.parallel,simd,fft, andndarrayimplystd; disabling default features gives the scalar, single-threaded paths.crates/no-std-smokeconsumer + a CI job building the library and the smoke crate forthumbv7em-none-eabihf.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-featuresbuilds clean on host andthumbv7em-none-eabihf.webarkit/purecv-esp32-examples(matrix arithmetic, Gaussian blur, andsolve_pnppose estimation).Closes #82
Closes #83
Closes #84
Closes #85
🤖 Generated with Claude Code