1

Is it possible to write PyOpenCV code using GPUs? I want to know if I can write the following on Python:

#include <opencv2/opencv.hpp> 
#include <opencv2/gpu/gpu.hpp> 
using namespace cv; 
int main() { 
 Mat src = imread("car1080.jpg", 0); 
 if (!src.data) exit(1); 
 gpu::GpuMat d_src(src); 
 gpu::GpuMat d_dst; 
 gpu::bilateralFilter(d_src, d_dst, -1, 50, 7); 
 gpu::Canny(d_dst, d_dst, 35, 200, 3); 
 Mat dst(d_dst); 
 imwrite("out.png", dst); 
 return 0; 
} 
talonmies
72.8k35 gold badges204 silver badges297 bronze badges
asked Nov 25, 2013 at 1:25

2 Answers 2

3

PyOpenCV stopped being updated after OpenCV 2.1.0, and it doesn't support OpenCV's GPU module.

Nowadays OpenCV offers it's own API for Python programmers, but unfortunately it also doesn't support the GPU module yet.

answered Nov 25, 2013 at 3:07
Sign up to request clarification or add additional context in comments.

2 Comments

So I think the only way to get "image processing productivity" is to get the raw data as "numpy" array and to process it using my own "CUDA or OpenCL" kernels right? Or... does exist any other alternative for OpenCV to work with DIPs on GPUs?
Actually, it's easier to just write Python wrappers yourself for the C++ GPU module. With this approach you don't have to code the algorithms yourself. ;)
0

unfortunately, you can't.

none of the gpu/cuda/ocl bindings are exposed to the scripting layer (so, same prob in java)

answered Nov 25, 2013 at 8:34

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.