How to ready X bytes of image from frame buffer

Hey again!

We are trying to send images from the camera as a POST request through a cell modem and need to feed the image to the modem.

At the moment we are using img.bytearray() to get the image as bytes and then feeding that to the modem. We have it working with SVGA black and white, but when increasing the image size or using colored images we run out of RAM on the board and have a memory allocation exception.

Is there a way for us to read X number of bytes directly from the frame buffer/image object so we can feed smaller portions of the image in at a time?

Bytearray is a reference. However, it’s probably getting copied in the library. You can send slices by using array notation on the end of img.bytearray()[0:100] and etc.

1 Like