How to get/(convert to) BGR images through nvxio?

Hi, recently our algorithms mainly use bgr raw image format. But I found VX_DF_IMAGE only supports:

VX_DF_IMAGE_VIRT
A virtual image of no defined type.
VX_DF_IMAGE_RGB
A single plane of 24-bit pixel as 3 interleaved 8-bit units of R then G then B data. This uses the BT709 full range by default.
VX_DF_IMAGE_RGBX
A single plane of 32-bit pixel as 4 interleaved 8-bit units of R then G then B data, then a don’t care byte. This uses the BT709 full range by default.
VX_DF_IMAGE_NV12
A 2-plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling. This uses the BT709 full range by default.
VX_DF_IMAGE_NV21
A 2-plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling. This uses the BT709 full range by default.
VX_DF_IMAGE_UYVY
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 bytes. This uses the BT709 full range by default.
VX_DF_IMAGE_YUYV
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes. This uses the BT709 full range by default.
VX_DF_IMAGE_IYUV
A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes. This uses the BT709 full range by default.
VX_DF_IMAGE_YUV4
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes. This uses the BT709 full range by default.
VX_DF_IMAGE_U8
A single plane of unsigned 8-bit data. The range of data is not specified, as it may be extracted from a YUV or generated.
VX_DF_IMAGE_U16
A single plane of unsigned 16-bit data. The range of data is not specified, as it may be extracted from a YUV or generated.
VX_DF_IMAGE_S16
A single plane of signed 16-bit data. The range of data is not specified, as it may be extracted from a YUV or generated.
VX_DF_IMAGE_U32
A single plane of unsigned 32-bit data. The range of data is not specified, as it may be extracted from a YUV or generated.
VX_DF_IMAGE_S32
A single plane of unsigned 32-bit data. The range of data is not specified, as it may be extracted from a YUV or generated.

how can I convert vx_images from RGB to BGR format?

Thanks!

If you don’t want to use opencv converter, you can try to extract channel first, and then combine them with preferred order.

For example:

vxChannelExtractNode(graph, inputRGB, VX_CHANNEL_R, channelR)
vxChannelExtractNode(graph, inputRGB, VX_CHANNEL_G, channelG)
vxChannelExtractNode(graph, inputRGB, VX_CHANNEL_B, channelB)
vxChannelCombineNode(graph, channelB, channelG, channelR, NULL, outputBGR)

Following tutorial also use channel extract and channel combine. You can take a look.
https://www.brainshark.com/nvidia/vwb-simplecv

Thanks AastaLLL!

Hi AastaLLL,

How can I convert VX_DF_IMAGE_S16 to VX_DF_IMAGE_U8?

Thanks

Hi,

Please check the convert bit depth node.
You can find more information of VisionWorks document:

VisionWorks API
Khronos OpenVX 1.1 API
OpenVX API Modules
Vision Functions
Convert Bit Depth

Thanks.