I was modifying the syncsensor example for my use case. I modified the code of the syncsensor in this particular function
ScopedCudaEGLStreamFrameAcquire::ScopedCudaEGLStreamFrameAcquire(CUeglStreamConnection& connection)
: m_connection(connection)
, m_stream(NULL)
, m_resource(0)
{
CUresult r = cuEGLStreamConsumerAcquireFrame(&m_connection, &m_resource, &m_stream, -1);
if (r == CUDA_SUCCESS)
{
cuGraphicsResourceGetMappedEglFrame(&m_frame, m_resource, 0, 0);
cv::cuda::GpuMat d_Mat_RGBA(m_frame.height, m_frame.width, CV_8UC4, m_frame.frame.pPitch[0]);
cv::cuda::GpuMat d_Mat_RGB (m_frame.height, m_frame.width, CV_8UC3);
cv::cuda::cvtColor(d_Mat_RGBA, d_Mat_RGB, cv::COLOR_RGBA2RGB);
cv::Mat h_Mat_RGB(m_frame.height, m_frame.width, CV_8UC3);
d_Mat_RGB.download(h_Mat_RGB);
//cv::imwrite("h.jgp",d_Mat_RGB);
}
}
I ran into this problem
fcr@fcr-desktop:~/tegra_multimedia_api/argus/build/samples/syncSensor$ ./argus_syncsensor
Executing Argus Sample: argus_syncsensor
Argus Version: 0.97.3 (multi-process)
PRODUCER: Creating left stream.
PRODUCER: Creating right stream.
PRODUCER: Launching disparity checking consumer
Initializing CUDA
CONSUMER: Connecting CUDA consumer to left stream
CONSUMER: Connecting CUDA consumer to right stream
CONSUMER: Waiting for Argus producer to connect to left stream.
PRODUCER: Starting repeat capture requests.
CONSUMER: Waiting for Argus producer to connect to right stream.
CONSUMER: Streams connected, processing frames.
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.1.1) /home/fcr/Downloads/JEP-master/script/opencv_contrib-4.1.1/modules/cudev/include/opencv2/cudev/grid/detail/transform.hpp:267: error: (-217:Gpu API call) unspecified launch failure in function 'call'
Aborted (core dumped)
I have Opencv 4.1 version. Can anyone tell me where I’m going wrong?