Ask Your Question
0

OpenCV CUDA Python Bindings

asked 2017-02-09 13:46:40 -0600

ostrumvulpes gravatar image

updated 2017-02-09 16:31:47 -0600

Hello everyone,

I am writing a Python-based application using OpenCV and its Aruco module for marker detection. I want to parallelize some parts of the application, and noticed that the latest OpenCV build on GitHub seems to have many of the CUDA module functions wrapped with export macros.

CV_EXPORTS double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type, Stream& stream = Stream::Null());

It seems that I should be able to call this directly from my Python code, but I have not been able to do so (as far as I know).

Is it still necessary at this point to use some external library to link my Python code with the OpenCV CUDA code, e.g., PyCUDA? Or am I already using the GPU implementation if I call cv2.threshold() if I've built OpenCV WITH_CUDA=ON?

Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-02-09 18:41:38 -0600

berak gravatar image

updated 2017-02-09 18:42:16 -0600

sadly, right now, you cannot use any opencv CUDA functionality from python, even if you built it WITH_CUDA=ON

the c++ code is using special data structures (GpuMat), which are not exposed to python in any way.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-02-09 13:46:40 -0600

Seen: 1,208 times

Last updated: Feb 09 '17