Convert from RGB565 to RGB888

Hello,

Is it possible to convert an RGB565 image to an RGB888 one ?

What I want to do is to convert images to RGB888 in order to increase significant figures of each pixel. I noticed that when I type for example print([img[2000]) , I get a list of 3 numbers coded in 8 bits, but I think that it is just a linear conversion of a number coded in 5 bits ( or 6 bits for the green component)

So I tested that by typing for example :
img = sensor.snapshot()

img[2000] = [ 23, 30, 23 ]
print(img[2000])

I get :

(25, 28, 25) instead of (23, 30, 23)(The values that I gave)

So I wonder if there is a way to convert to rgb888 in such a way as to increase the number of significant digits.

Nope, we just have two images types: RGB565, and grayscale (8-bits), and we’ll be adding binary very soon too.

If you want RGB888 data please set the camera mode to RAW and you’ll get a bayer pattern in the frame buffer. All our image processing code work won’t on a bayer pattern… but, you’ll be able to save jpegs and you can manually access the pixels which are now 8-bits each using set_pixel() and get_pixel().

Thank you very much.

Could you just explain to me how to set the RAW mode ? Sorry I just started with OpenMV, I haven’t got used to it yet.

I forgot to precise that I have the CAM M7

Thank you for your patience.

Looks like is ins’t documented right now. Give me to the next release. Also, just set the res to VGA with RGB565 and the mode internally will get set to RAW.

Use this:

sensor.set_pixformat(sensor.BAYER)