Cannot take a picture in VGA resolution


#1

Hello,
I’m trying to save an image in VGA resolution with this code

import sensor, image

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.VGA)
sensor.run(1)
sensor.skip_frames(100)
print("init ok")

path = "/sd/image.jpg"
img = sensor.snapshot()
print("save image")
img.save(path)

sensor.shutdown(0)

However, the image is not saved and the board crashes with this error: sensor_check_buffsize: Image size too big to fit into buf!
How can I increase the size of the buffer?
I’m using MicroPython v0.3.2 and Maix Dock.
Thanks!


#2

We consider to reserve more memory for AI model, so we limit resolution to QVGA RGB565.
If you want append to VGA, you need modify the buf size of “MAIN_FB”, and recompile it.
also you can post an issue on maixpy’s github, we can upload VGA-compatible image for you. (it will decrease about 0.5MB free memory).


#3

Thanks!
I’ll ask on github.