How to get RGB Sensor Data with Argus library

For my progect, We need to get ARGB Data(processed by ISP WhiteBalance)
I’m learnning some argus sample yuvJpeg/useAutoWhiteBalance/oneShot,
But I still not know how to get camera sensor RGB Sensor data with argus api.
It is better if you can provide us more sample code?

HI 27653276,
The output Frames from Argus API is EGLImage and currently supports only YUV420 output. You may have to convert the EGLImage to NvBuffer in order to get the processed frame in ARGB format.

You can refer this link for reference to get processed frames.
[url]https://devtalk.nvidia.com/default/topic/1037863/jetson-tx2/argus-and-opencv/[/url]

There are other samples available which can also help you understand.
Refer 13_multicamera and 09_camera_jpeg_capture samples inside tegra_multimedia_api/samples.

You may have to choose the following NvBufferColorFormat:
NvBufferColorFormat_ARGB32

Hi waisskharni.sm,

Thank you very much for your kindly help!

I’m refer to 09_camera_jpeg_capture samples to learn how to get ARGB format data from YCbCr420

// Get the IImageNativeBuffer extension interface.
NV::IImageNativeBuffer *iNativeBuffer =
interface_castNV::IImageNativeBuffer(iFrame->getImage());
if (!iNativeBuffer)
ORIGINATE_ERROR(“IImageNativeBuffer not supported by Image.”);

    // If we don't already have a buffer, create one from this image.
    // Otherwise, just blit to our buffer.
    if (m_dmabuf == -1)
    {
        m_dmabuf = iNativeBuffer->createNvBuffer(iStream->getResolution(),
                                                 NvBufferColorFormat_YUV420,
                                                 NvBufferLayout_BlockLinear);
        if (m_dmabuf == -1)
            CONSUMER_PRINT("\tFailed to create NvBuffer\n");
    }
    else if (iNativeBuffer->copyToNvBuffer(m_dmabuf) != STATUS_OK)
    {
        ORIGINATE_ERROR("Failed to copy frame to NvBuffer.");
    }

    // Process frame.
    processV4L2Fd(m_dmabuf, iFrame->getNumber());

   the 'm_dmabuf' is one handle for NvBuffer  
   My question is how to get the CPU data pointer for finial ARGB Data from NvBuffer.
   Are there any document or sample how to access NvBuffer?

Thanks,
Martin

Hi Martin,
You need to know the plane sizes and copy accordingly to a pointer using memcpy. Kindly check these two forum threads. They can help you on how to access the CPU pointer from NvBuffers.

https://devtalk.nvidia.com/default/topic/966938/jetson-tx1/how-to-achieve-the-h-264-encoding-performance-4k-3-840x2-160-30fps-with-openmax-il-api-l4t-r24-1/2

[url]https://devtalk.nvidia.com/default/topic/995449/how-to-get-the-nvbuffer-from-nvbuffergetparams/[/url]