v4.5.9

v4.5.9 brings raw preview streaming for boards without a hardware JPEG encoder, hardware sensor cropping to free more RAM, faster Helium-accelerated debayering, and a batch of camera/USB-debug fixes. It also changes the AprilTag result API and the default AprilTag family set, so read the breaking changes below.

Highlights

  • Raw preview streaming — boards without a hardware JPEG encoder can now send downscaled raw frames to the IDE/host instead of failing to preview.

  • Hardware sensor cropping — setting a smaller frame size now reduces per-buffer memory and frees RAM for fb_alloc().

  • Faster debayering — Bayer→RGB/grayscale conversion is now Helium-SIMD accelerated on Cortex-M55 boards.

  • Breaking: the AprilTag result object changed to attribute access and the default AprilTag family set was reduced (see the AprilTag changes and the AprilTag family change).

New features

  • Raw preview streaming — boards without a hardware JPEG encoder can bypass JPEG and stream downscaled raw frames (capped at ~60 KB) to the IDE/host, so live preview works on those boards.

Other changes and improvements

  • Hardware cropping is now enabled on all STM32/NXP boards (Giga, Nicla Vision, Portenta H7, OpenMV 1–4 / 4 Plus / Pure Thermal / RT1060). When a frame size or window is set, per-buffer memory is reduced to the cropped size, freeing more RAM for fb_alloc().

  • Faster debayering — Bayer→RGB565/grayscale conversion is now ARM Helium/MVE SIMD accelerated on Cortex-M55 boards (e.g. RT1060), with a shared SIMD JPEG-encoder path.

  • Faster IDE debug — the debugger now transfers data directly from the USB stack when possible, avoiding an extra copy.

  • MicroPython submodule updated — boards can resize the TinyUSB CDC buffer, plus GC and build-rule fixes.

Bug fixes

Camera and sensors:

  • Corrected the OV7725 Bayer/CFA pattern (GBRG → BGGR), fixing debayered color output on OV7725 cameras; the OV7725 now reports the Bayer pixel format, and Bayer-only sensors now report a 1-byte-per-pixel source depth.

  • Fixed the raw/Bayer framebuffer size calculation.

Machine learning:

  • TensorFlow Lite Micro now uses the GC heap’s free memory when sizing the temporary tensor arena, preventing model-load allocation failures on boards with limited frame-buffer memory.

Host / IDE:

  • Fixed USB-debug CDC buffer handling on TinyUSB boards for more reliable serial/debug throughput.

  • tools/pyopenmv: fixed RGB565 byte order, added a scale argument, and the frame-buffer tool now reports image size/format.

Hardware and board support

  • OV7725 now reports the Bayer pixel format (correct raw/CFA handling).

  • Hardware cropping enabled across the STM32/NXP board range.

Breaking API changes

User-visible API breaks between v4.5.8 and v4.5.9. Scope: Python C-modules in modules/ and Python libraries in scripts/libraries/.

Each change is tagged with its impact:

  • minor — narrow API; only affects scripts that used it.

  • behavior — same API, different results; re-check tuned scripts.

Changes are grouped by impact in that order. If you just want to port your code, jump to the migration checklist at the end. Each commit hash links to its diff on GitHub.

AprilTag result objects and set_buffers (minor)

AprilTag results from find_apriltags() now expose their data as attributes instead of methods — use tag.cx, tag.cy, tag.rotation, tag.family, tag.corners instead of tag.cx(), tag.family(), etc. New name (family name string) and float-precision cxf / cyf accessors were added.

Separately, the automatic video-buffer configuration changed: set_buffers replaces auto_adjust — pass -1 to use up to three buffers of the frame size (or the most that fit) and 1 to use the whole frame buffer. Buffer sizing is now bits-per-pixel aware, so more buffers can be allocated for 1 bpp formats.

Commits: c0d4759f8, 7b36e4ef6

ble_advertising and RPC-over-network removed (minor)

The ble_advertising helper library and the ble_temperature.py example were removed — use aioble instead (an aioble temperature example is provided). The RPC network master/slave classes were removed from rpc.py.

Commits: 6513276c1, 44a7e579d

AprilTag families disabled by default (behavior)

AprilTag families are now individually compile-time selectable, and the unused ones are disabled by default. On standard boards find_apriltags() now detects only the TAG36H11 family unless the firmware is rebuilt with other families enabled. Scripts relying on other families (TAG16H5, TAG25H9, …) on a standard build will silently stop detecting them.

Commit: effe12f2c

Migration checklist

For a clean port to v4.5.9 the typical work is:

  1. Change AprilTag result access from method calls to attributes (tag.cx()tag.cx), and switch auto_adjust to set_buffers (the AprilTag / buffer changes).

  2. Replace ble_advertising with aioble and drop any RPC network master/slave use (the removals).

  3. If you use AprilTag families other than TAG36H11 on a standard build, note they are no longer detected by default (the AprilTag family change).