I want to do colour detection on detected objects using OpenCV. Using OpenCV CPU imposed significant overhead so I want to switch to OpenCV CUDA in hope of seeing better real-time performance. There are examples on how to convert NvBufSurface to cv::Mat but I couldn’t find any example on how to convert NvBufSurface to cv::cuda::GpuMat. So how do I use OpenCV CUDA with Deepstream buffer to improve performance?
Thank you for your response, I have read the thread and the document it links to. I have a follow-up question, why do I have to run cv::cuda::swapChannels(gpuMat, aDstOrder); with const int aDstOrder[] = {2,0,1,3};, what is the original colour space and what is the new colour space? Are we doing RGBA to BRGA?
There is no update from you for a period, assuming this is not an issue anymore.
Hence we are closing this topic. If need further support, please open a new one.
Thanks
It’s only a sample, please convert as needed, the origin is RGBA. please refer to cv::cuda::swapChannels in OpenCV: Color space processing