Ask Your Question

Revision history [back]

Hello,
As far as I know you would need to compile the opencv python bindings from source to activate the CUDA support. This is rather technical unless you are used to compiling stuff.
Alternatively instead of CUDA you can use OpenCl to run code on GPU which is activated by default in opencv releases.
Just convert your Mat objects into UMat using the cv2.UMat(Mat) command.
Then the opencv functions will automatically run on the gpu using opencl.
See this blog post https://www.learnopencv.com/opencv-transparent-api/

Keep in mind that you might not always see a speed up depending on the size of the images and the operations.