.. _changelog_v4_5_3: v4.5.3 ====== v4.5.3 is a large release: OV5640 autofocus, anti-aliased line drawing, a mainlined hardware JPEG decoder, big i.MX RT (RT1060) capability gains, and a broad set of camera/ISP fixes. Several rarely-used image methods were removed and some ISP/display APIs changed — read the breaking changes below. .. contents:: On this page :local: :depth: 1 Highlights ---------- - **OV5640 autofocus** — enabled on OpenMV 4 / 4 Plus / RT1060 (``sensor.ioctl(sensor.IOCTL_TRIGGER_AUTO_FOCUS)``), with an example. - Anti-aliased ``draw_line()`` and a mainlined STM32 hardware JPEG decoder (faster JPEG decompression). - **OpenMV RT1060** gained ulab, ISP ops, ``set_framerate()`` / ``set_frame_callback()``, a much larger frame buffer, and the CAN driver. - **Breaking:** ``Image.div()`` / ``cartoon()`` / ``mul()`` were removed and some ISP/display APIs changed — see the breaking changes. New features ------------ - **OV5640 autofocus** — autofocus firmware is enabled on OPENMV4, OPENMV4P, and OPENMV RT1060; trigger it with ``sensor.ioctl(sensor.IOCTL_TRIGGER_AUTO_FOCUS)``. A new ``07-Sensor-Control/autofocus.py`` example was added. - **Anti-aliased line drawing** — ``draw_line()`` gained anti-aliasing. - **Custom SPI display controllers** — ``SPIDisplay`` now accepts a ``controller=`` keyword and exposes a ``bus_write`` hook for custom init/command sequences. - ``Image.ccm()`` upgrade — now accepts nested 3x3 / 4x3 / 3x4 / 4x4 matrices and ulab arrays (with an optional per-channel offset row); added a color-correction example. - **i.MX RT JPEG capture** — ``sensor.JPEG`` capture on Arduino Portenta/Nicla Vision/Giga, plus ``set_framerate()`` and ``set_frame_callback()`` on the mimxrt port. - **TFLite model validation** — models now carry an operator-order hash and operator-set size. - **WiFi** — added CYW43 security-mode constants; new i.MX RT board-control example scripts (Pin/ADC/CAN/I2C/PWM/SPI/UART/...). Other changes and improvements ------------------------------ - **MicroPython updated to 1.22**; CMSIS updated to 5.9.0. - **Mainlined STM32 hardware JPEG decoder** — faster JPEG decompression on the on-chip codec. - Optimized ``Image.invert()`` / ``negate()`` and binary/math image operations (CMSIS intrinsics). - The :mod:`rpc` and :mod:`vl53l1x` libraries were made portable (use :mod:`machine` / :mod:`time` instead of :mod:`pyb`), so they run on non-STM32 ports. - DMA-accelerated frame-buffer memcpy on OpenMV H7 / H7 Plus / Pro / Pure Thermal and Arduino Giga / Nicla Vision / Portenta H7; STM32 now scans I2C devices once per scan for faster boot. Bug fixes --------- Camera and sensors: - Fixed STM32 camera XCLK to a true 50% duty cycle and a bug when the camera clock frequency is set to zero; fixed Bayer crop+transpose, YUV422 color shift, and ``set_windowing()`` on the mimxrt port. - Fixed the GC2145 chip-ID probe and hmirror/vflip on rotated mounts; fixed PAJ6100 on the RT1062 and a PixArt PAJ7620/PAW3902 SPI buffer overflow. Image processing: - Fixed ``find_rects()`` roi clipping, ``morph()`` fractional offset truncation, ``image.gamma()`` contrast/brightness defaults, ``get_threshold()`` A/B offsets on RGB565, and JPEG decoding of dimensions not a multiple of 8. System and libraries: - :meth:`machine.LED.value` with no argument now returns the LED state instead of clearing it; fixed SPI SSEL deinit on a shared bus, :func:`machine.deepsleep` on the RT1062, a TF crash on missing operators, and WINC1500/ninaw10 NIC auto-activation on ``connect()``. Hardware and board support -------------------------- - **OpenMV RT1060** — ulab and ISP ops enabled, larger frame buffer (10M→20M) / fb_alloc (2M→11M), CAN driver restored, more heap. - **Arduino GIGA** — GC2145 camera support, with GC2145/OV5640 auto-detection (they share an I2C address). - **i.MX RT** — ``sensor.JPEG`` capture support. Breaking API changes -------------------- User-visible API breaks between v4.5.2 and v4.5.3. 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 :ref:`migration checklist ` at the end. Each commit hash links to its diff on GitHub. .. _v4_5_3_removed: Removed image methods *(minor)* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``Image.div()``, ``Image.cartoon()`` (and its example), and ``Image.mul()`` were removed. *Commits:* `7c932602e `__, `055a468b8 `__, `4fe7fb63b `__ .. _v4_5_3_display: Display module API *(minor)* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The legacy ``udisplay`` module-name fallback was removed — the module is registered only as :mod:`display`. The DSI-only ``dsi_write()`` / ``dsi_read()`` methods were replaced by ``bus_write()`` / ``bus_read()``, which are now available on all display controllers. *Commits:* `7df6694c3 `__, `7d1f378a0 `__ .. _v4_5_3_libs: MQTT and tf.regression API changes *(minor)* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The :mod:`mqtt` library's ``MQTTClient`` was reworked: ``port`` is now required, new ``ssl_params`` / ``callback`` constructor keywords and a ``timeout`` argument on ``connect()`` were added, the old ``ssl=`` / ``port=0`` defaults were removed, and ``check_msg()`` is now non-blocking. ``tf.regression()`` was rewritten — its signature is now ``regression(model, array)`` and it handles 1D/2D/3D and quantized (int8) models. *Commits:* `d12874c63 `__, `c5ec576c1 `__ .. _v4_5_3_isp: ISP / sensor behavior changes *(behavior)* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``Image.awb()`` was reworked — gray-world (default) vs white-patch (``max=True``) is now explicit, and the ``max`` argument plus ``Image.gamma()``'s ``gamma`` / ``contrast`` / ``brightness`` arguments are now keyword-only (positional calls must be updated). Image transpose is now disabled for YUV422 (it previously produced incorrect output) and the YUV422 color shift was corrected to match Bayer. The STM32 JPEG path now raises an error on a JPEG geometry mismatch instead of producing a corrupt image, and WiFi AP mode now applies a default security mode on the STM32 and i.MX RT ports. *Commits:* `36d5cecbd `__, `00500ccde `__, `c1eeaefd6 `__, `333fb2b5f `__, `55cab8733 `__, `c7d40f6af `__ .. _v4_5_3_migration: Migration checklist ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For a clean port to v4.5.3 the typical work is: #. Stop using ``Image.div()`` / ``cartoon()`` / ``mul()`` (:ref:`the removed methods `). #. Import the display module as :mod:`display` and switch ``dsi_write``/ ``dsi_read`` to ``bus_write``/``bus_read`` (:ref:`the display API change `). #. Update ``MQTTClient`` construction (``port`` is required; ``ssl_params``/``callback``) and any ``tf.regression()`` calls (:ref:`the library API changes `). #. Pass ``awb()`` ``max`` and ``gamma()`` ``gamma``/``contrast``/ ``brightness`` as keyword arguments, and re-check YUV422/transpose and AP-mode security assumptions (:ref:`the ISP/sensor changes `).