How to get opencv images from argus/syncsensor sample?

Hi folks,

I use Jetpack 4.2.1 on jetson nano b01 board.
I have OpenCV 4.2.0 cuda supported.

I want to modify syncsensor sample to get mat object.

cuGraphicsResourceGetMappedEglFrame(&m_frame, m_resource, 0, 0);

Under above code, I added ;

cv::cuda::GpuMat gpu_rgba(m_frame.height, m_frame.width, CV_8UC4, m_frame.frame.pPitch[0]);
cv::cuda::GpuMat gpu_rgb (m_frame.height, m_frame.width, CV_8UC3);
cv::cuda::cvtColor(gpu_rgba, gpu_rgb, cv::COLOR_RGBA2RGB);
cv::Mat cpu_mat(m_frame.height, m_frame.width, CV_8UC3);
gpu_rgb.download(cpu_mat);

But it does not work.

I have an error.

error: (-217:Gpu API call) unspecified launch failure in function ‘call’.

What do I have to do to get cv::mat object from syncsensor sample, could you help me, please?

Thanks for support.

Hi,
You may refer to this patch: