Camera retrieve_image: RGBA or BGRA?

Hi!

I’ve been quite confused for a while about this for a while, but are the images retrieved from the camera RGBA or BGRA by default? I know the documentation says RGBA is returned, but for example if I am trying show the image with opencv (which asks for BGR image) I get something quite weird.

If I convert the image like the following, the colors are completely messed up.

cam.retrieve_image(mat, sl.VIEW.LEFT)
data = mat.get_data()
data = cv2.cvtColor(data, cv2.COLOR_RGBA2BGR)
cv2.imshow(“ZED”, data)

However, if I transform the image like the following, everything is fine:

data = cv2.cvtColor(data, cv2.COLOR_BGRA2BGR)

So, in the end, are the retrieved images RGBA or BGRA?

@cpene1 the images are in BGRA format.
Can you point us to the documentation where RGBA is reported so we can fix it?

It’s quite a relief to be honest :sweat_smile:

All the View’s python documentation suggest the images are RGBA:
https://www.stereolabs.com/docs/api/python/classpyzed_1_1sl_1_1VIEW.html

Looking now at C++, I see it’s just a documentation issue.

Thanks for support!