UYVY Cuda color conversion

Is there a cuda implementation that converts UYVY images to RGB ? I have a cv::cuda::GpuMat that is in UYVY format and I have not been able to convert it to RGB.

To do so in OpenCV on the CPU, the function cv::cvtColor(Mat in , Mat out, COLOR_YUV2BGR_UYVY) does the job. However the cuda implementation of the same function in Cuda ( cuda::cvtColor(cuda::GpuMat in , cuda::GpuMat out, COLOR_YUV2BGR_UYVY) ) does not work as it says the color conversion code is not supported.

I found this code here that supposably does the conversion but it takes arguments as (char2 *) and (char4 *) rather than GpuMat. Any help would be appreciated.



You can get GPU data pointer via

GpuMat d_mat;
uchar* d_data_pointer =;

And can pass the data pointer to the jetson_inference CUDA function.