Draw_string on Nicla Vision

Hello,

context

I used an Nicla vision board to cast video using a TCP/JPEG video stream.
It’s work with low latency !

I want to had some text on image with “draw_string” function

Sensor is initialized to RGB565

sensor.set_framesize(sensor.WVGA)
sensor.set_pixformat(sensor.RGB565)
frame = sensor.snapshot()

Try to manipulate image

frame.set_pixel(0,0) => OK
frame.draw_string(5,5,“text”) => Image is not mutable!

I’ve got an error on draw_string
If I try with GRAYSCALE image, It’s OK

Frame is not compressed but draw_string failed.
Why ??
thanks :slight_smile:

It’s because we don’t have enough RAM so we converted the image to BAYER which draw_string() doesn’t work on. This happens silently. A bayer image is 2x less RAM than RGB565… but, it’s still color so we debayer it on the fly in our code base.

Anyway, the API will be updated to allow draw_string() to work on a bayer image. However, I have not yet gotten to this. Many functions now directly work on BAYER images. But, drawing functions do not yet.

OK thanks kwagyeman !
so no solution right now.
I will open another topic for sw architecture with openmv

print(img)

To see the image type. This will help you debug when this happens. My goal is to improve the API to a point where you can just do things on RAW bayer images.

This is actually quite important as when we start using higher end camera sensors they will not have an ISP and it will make sense if our code base can work directly on RAW bayer images.

ok. thanks for this advice :grinning: