Convert YUV420 NvBuffer to BGR

Hi guys,

I use L4T 28.2.1 and a IMX274 camera.
I would like a RGB/BGR cv::mat at the end of the acquisition.

Currently, using Argus API I have an image in an NvBuffer accessible by the dmabuf-fd.

How can I convert YUY420 NvBuffer to BGR ? Is it possible using VIC ?


hello pecchioli.mathieu,

please refer to Topic 1047563 to demonstrate tegra_multimedia_api + OpenCV GpuMat.

Hello JerryChang,

Thank you for your quick reply.

If I well understand the patch in attachment, the conversion to a OpenCV GpuMat is done using a renderer to retrieve an EGLImageKHR. But I do not want to use a screen and therefore can not initialize the renderer.
Is it possible to recover the image in another way from the fd memory handle?

hello pecchioli.mathieu,

please refer to Accelerated GStreamer User Guide from [Release 28.2 Development Guide]-> [Related Documentation]
you may refer to gst-nvivafilter plugin in page.20 to perform CUDA post-processing for your use-case.