Hi lightbringer, I may be wrong but I think you are confusing CUDA and the OpenCV CUDA API.
-
If you want to use CUDA and OpenCV together then you need to know how to program in CUDA, then the only extra piece of the puzzle is passing the pointer of your GpuMat to your kernel as @tmanthey suggested and as shown in the code provided by @dandelion1124, see here for the bit you need. If you are not familiar with CUDA then this may not be what you are looking for.
-
If you want to use the OpenCV CUDA API then there are many many more examples in C++ than in python. The python API to cv::cuda was only released in Aug 2018 and hardly anyone uses it. For C++ every function in the
cv::cudanamespace has a unit test written showing how to call it, e.g. cudaarithm.
From your initial question I would infer that you need to learn CUDA (1), however depending on the processing you need to do, you may find there is an OpenCV cv::cuda function or combination of functions which will achieve your goal. I hope this helps.