How can i get data from CUeglFrame to host memory?

Just as the “\jetson_multimedia_api\argus\samples\cudaHistogram”,after cuGraphicsResourceGetMappedEglFrame,i will get CUeglFrame,the PIXEL_FMT_YCbCr_420_888 nv12 data is on gpu,how can i get it to memory? copy it ? just like cv::Mat ,or GpuMat

Hi,

The buffer pointer can be found at cudaEGLFrame.frame.pArray[0].
The you can create a GpuMat by wrapping over it.

https://docs.opencv.org/4.1.1/d0/d60/classcv_1_1cuda_1_1GpuMat.html#ab7210166f4bd124855b520b3dde28fb1

GpuMat() [7/11]
cv::cuda::GpuMat::GpuMat ( int rows,
int cols,
int type,
void * data,
size_t step = Mat::AUTO_STEP
)

constructor for GpuMat headers pointing to user-allocated data

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.