OpenMV AE3 Grayscale issue with PAG7936 in HD

When the FRAMESIZE is set to csi.HD, there is an issue when converting to grayscale where the image is turned to noise. See images and video for behavior. Check the min reproduceable example below. Simply remove to_grayscale() to see it working.

# Untitled - By: samke - Fri Apr 17 2026

import csi
import time

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565)
csi0.framesize(csi.HD)
csi0.snapshot(time=2000)

clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot().to_grayscale()
    print(clock.fps())

grayscale.bmp (2.5 MB)

no_grayscale.bmp (1.2 MB)

That’s related to the GPU driver on the alif being invoked when not finished. Will have a fix soon: ports/alif: Fully implement Alif GPU driver. by kwagyeman · Pull Request #2910 · openmv/openmv · GitHub . The GPU cannot be used to convert RGB565 to grayscale, but, the current driver doesn’t catch that.

firmware_M55_HP.zip (1.4 MB)

Give this firmware a try. Note that we’ve updated the API with breaking changes. We are nearing a big release. See the latest examples on the github for the up to date API.

Thanks for the update, it seems to be working for me! I will need to check on the API changes. I did not encounter any errors in my limited testing, so maybe I had nothing that clashed with the new API.

Another thing to look at/ add to the big release is this line (152) in ‎boards/OPENMV_AE3/imlib_config.h

// Enable high res find_apriltags() - uses more RAM
152// #define IMLIB_ENABLE_HIGH_RES_APRILTAGS

When this line is uncommented (current state), the apriltag algorithm gives a memory error. So it needs to be commented out for the ae3 apriltag library to work. (see: Arduino Nicla out of Fast Frame Buffer Stack Memory (it's different this time, I promise) - #3 by skemp117)
Traceback (most recent call last):
File “”, line 18, in
MemoryError: Out of fast frame buffer stack memory
OpenMV v4.8.1; MicroPython v1.26.0-77; OpenMV-AE3 with AE302F80F55D5AE
Type “help()” for more information.. :frowning:

Can you send the example script that is having an error?

firmware_M55_HP.zip (1.4 MB)

Use this file. Hardware limits on the high reses are fixed.

That version you sent seems to be working fine up to VGA. It still hangs at HD on the AE3. IDK what is going on under the hood, so I can only speculate. It does not throw any errors, it just sits stuck in the loop.

Here is the script that was having the error:

import csi
import time

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.GRAYSCALE)
csi0.framesize(csi.HD)
csi0.snapshot(time=2000)


while True:
    img = csi0.snapshot().crop(x_scale=.05, y_scale=.05)
    tag_list = img.find_apriltags()
    print(tag_list)

Scale could not be set to anything greater than .01 without an error.

Give me a bit to debug this. Had to switch tasks away from the GPU.