Skip to content

feat(imgproc): no_std support for the imgproc module (Phase 2) - #88

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

feat(imgproc): no_std support for the imgproc module (Phase 2)#88
kalwalt merged 3 commits into
feat/no_stdfrom
feat/no-std-imgproc-phase2

Conversation

@kalwalt

@kalwalt kalwalt commented Aug 3, 2026

Copy link
Copy Markdown
Member

Makes the imgproc module compile under no_std + alloc with --no-default-features, using scalar fallbacks (parallel & SIMD disabled). Second step of #82, building on Phase 1 (#83).

imgproc is un-gated in lib.rs and now builds with only core + alloc. The change is almost entirely mechanical:

  • std:: paths → their core:: equivalents (any::TypeId, iter::Sum, slice::from_raw_parts, f64::consts::PI, cmp::Ordering, cmp::Reverse)
  • alloc::{vec, vec::Vec, format, string::ToString} imports where used
  • concrete f32/f64 math (sqrt, floor, round, exp, atan2, …) resolves through num_traits::Float (libm) in no_std builds, same pattern as core
  • hough_lines_p (probabilistic Hough) is gated behind std: it shuffles edge points with the thread-local RNG (rand_shuffle), which stays std-only until a no_std seedable RNG lands (a Phase-1 follow-up, see Feature request: no-std support so purecv can run on microcontrollers such a esp32 #82). The deterministic hough_lines remains available on no_std.

Rayon (parallel) and pulp (simd) were already feature-gated and both imply std since Phase 1, so they compile out on bare metal with no further work — the scalar path is the sequential branch that was always there.

The crates/no-std-smoke consumer now also exercises gaussian_blur, and the CI no_std Build job (already building --no-default-features for thumbv7em-none-eabihf) now covers imgproc too.

Verified: 308 lib + 40 doctests pass with default features; clippy/fmt clean on no-default / default / simd+parallel; builds for thumbv7em-none-eabihf; and the ESP32-S3 example runs correctly on real hardware against this tree.

Out of scope (Phase 3, #85): video and calib3d.

Closes #84
Refs #82

🤖 Generated with Claude Code

kalwalt and others added 3 commits August 3, 2026 13:47
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>
@kalwalt kalwalt self-assigned this Aug 3, 2026
@kalwalt kalwalt added enhancement New feature or request rust-code rust Pull requests that update rust code imgproc-module labels Aug 3, 2026
@kalwalt
kalwalt merged commit fba86eb into feat/no_std Aug 5, 2026
4 checks passed
@kalwalt
kalwalt deleted the feat/no-std-imgproc-phase2 branch August 11, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant