Are OpenCV python images OpenGL accelerated?

asked 2014-07-08 17:22:55 -0600

Raoul gravatar image

updated 2014-07-09 00:56:21 -0600

berak gravatar image

Reading the OpenCV documentation, I do understand that a namedWindow() created with the flag WINDOW_OPENGLwill enable OpenGL support, meaning that in C++, you could feed the imshow() function with gpu data types, such as gpu::gpuMat.

However, when using an OpenGL-enabled namedWindow()with Python, will the numpy arrays fed to imshow() be displayed as OpenGL accelerated images (i.e will be passed to the gpu)? If not, is there a way to display OpenGL accelerated images in a namedWindow() using the Python interface?

edit retag flag offensive close merge delete

Comments

1

wait, that's wrong. you can't feed gpuMat's to imshow, not even with opengl.

opengl support will let you draw textured 3d meshes to the screen (instead of 2d images).

but even for that, the opencv libs have to be compiled against opengl libs, check that with:

print cv2.getBuildInformation();

it should say WITH_OPENGL=ON somewhere at the bottom.


also, afaik, you can't even access gpuMat's from python (or java) . if you want to code CUDA, you will have to use opencv's c++. api.

berak gravatar imageberak ( 2014-07-09 00:55:45 -0600 )edit

@berak Ok, thank you! However, I seem to remember that cvMat types fed to imshow() does allow OpenGL acceleration. And it seems to be accessible to python: https://code.google.com/p/pycvgl/ so I guess I'll use that...

Raoul gravatar imageRaoul ( 2014-07-10 22:25:04 -0600 )edit