Newbie Q: Convert VideoCapture buffer (PIL.Image) to Texture

Im trying to display vido from webcam in Panda and I cant seem to move the data from the camera to Panda (FFMpegTexture/OpenCVTexture ).

I have tried: … highlight=

but there doesnt seem to be any such thing as OpenCVTexture in the latest install the closest thing I found was in but i cant figure out how to grab the class.

325 13 FFMpegTexture 75777 13 FFMpegTexture 13 FFMpegTexture 0 0 0 1 195 0 0 1 196 0 1 0 326 0 0 0 0 408
//       Class : OpenCVTexture

So i thought id try using python VideoCapture( ) -> PIL-> Panda. Is there something to convert between the two formats (PIL-> Panda)?

any ideas? or do i have to rebuild from the panda source? (panda\src\grutil\openCVTexture.h exists so maybe thats where to go next?)

thanks in advance


Okay, this is weird. Can’t you import OpenCVTexture at all? What is the exact error you are getting when doing this:

from pandac.PandaModules import OpenCVTexture
    from pandac.PandaModules import OpenCVTexture
ImportError: cannot import name OpenCVTexture

Everything else seems to be importing correctly both of the following import correctly:

from pandac.PandaModules import FFMpegTexture
from pandac.PandaModules import VideoTexture

Which binary on the download page did you use? The windows build?
And, which version? It might be that 1.5.2 isn’t working while 1.5.3 is, or the other way.


Looks like openCVTexture.I wasnt included somehow. Although ffmpegTexture.I and fisheyeMaker.I were.

Can you try installing 1.5.2 to see whether it works there?
This seems like either a problem in the build system or just an accidental omission when it was compiled.

Yup, ill give it a bash tonight… let you know how it goes :slight_smile:

Aww no luck - maybe its been broken for a while - I guess I’ll have to try the compile from src route.


Hmm, I’ve been investigating this some more and it appears to be a bug in the build system. I’ll look into fixing it and making sure OpenCV will be included in the build.
If you want to compile Panda3D from scratch, you’d need a patch for OpenCV. When I fixed the bug and have a patch, I’ll send it to you, if you want.

EDIT: Disregard my former message. I’m seeing OpenCV is somehow in the thirdparty packages for VC7 but not for VC8. I’ll make sure it gets fixed in the next release.

Awesome! Thanks for taking the time :slight_smile: