ValueError: Expected a mutable image


I want to know why this code:

import sensor
import time
import machine

sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.HD) # Set frame size to QVGA (320x240)
sensor.skip_frames(time=2000) # Wait for settings take effect.

img = sensor.snapshot()

Generates this error:


Hi, which board are you using? Does it have SDRAM? If not, then there’s not enough RAM to store the image and we converted it to bayer which is a format we primarily use for just viewing. However, most of our functions cannot process it.

You need to lower your resolution.

Thank you for the explanation.

Im using Nicla Vision and I think that is exactly the problem.

Yeah, you need to stay at 320x240 or lower.

in fact using HVGA 480x320 is also possible to apply some methods.

Thank you again for the fast response