How to read/write pixel values in the dwImageNvMedia structure

Hi,

I would like to get access to pixels in the dwImageNvMedia structure which is used for GMSL camera reading for further processing.
I saw that it holds a pointer on NvMediaImage structure, and then I cannot find where are pixels.

Thank you in advance.
Sacha

Hi sacha,
All the data structures in Nvmedia are of abstract type. NvMediaImage does not directly expose the pointer to the image data. One way to modify the Image data contents is to use NvMediaImagePutBits API. Another way is, if the application sets NVM_SURF_ATTR_CPU_ACCESS_CACHED/UNCACHED,Then application can call NvMediaImageLock API and get the pointer information from NvMediaImageSurfaceMap structure. Please refer to Autonomous Vehicle Development Platforms | NVIDIA Docs to know more about NVmedia API. Please take a look at some Nvmedia samples to know how to modify image.

Hi SivaRamaKrishna,

Thank you very much for your answer, it is helpful.
Most of the driveworks processing functions needs a dwImageCUDA parameter, e.g. dwStereoRectifier_rectify.
Therefore, I would like to ask you whether there is a simple way to convert the dwImageNvMedia into dwImageCUDA.
Currently we have a segmentation fault when calling the dwStereoRectifier_rectify function.

Thank you in advance.
Sacha

Hi sacha,
Can you please check if imageStreamer helps. ImageStreamer can be used to transfer nvmedia frames to cuda without making any copies.

Hi SivaRamaKrishna,

We tried, however, we still have a segmentation fault. We try to modify the sample “camera_multiple_gmsl” to add the stereo rectification.
Could you please share some similar code, or give some more detail on how to solve our issue?

Thank you in advance.
Sacha