Hello, I am trying to write a script for the BGE that uses openCV. I have installed openCV, python 2.7, and blender 2.62, all on windows 7. When I run a script from within the GE, it doesn’t like the import cv command even though I can open python and run that command, and it imports just fine.
I guess what I’m wondering is where blender looks for these things, and how I can tell it to use the installation of Python, or look in the same places as is does.
Blender 2.62 uses python 3, which isn’t yet supported by openCV. The solution I’ve found has been to install python 2.6, blender 2.49b, and then I am able to use the openCV libraries in the GE. That’s the workaround I’ve come up with, although I imagine that it should be possible to right your own python wrappers for openCV that would be compatible with python 3 if you really needed to use blender 2.62
I have been able to get a video stream from my webcam and alter it (using a dilate or erode filter) and then display it live as a texture in the game. Unfortunately it has been rather slow, so I will try to see if it can be improved by not re-importing everything… I’ll let you know if I get any more useful results.
Thanks, for the time being Ive gone for a small hack where I just make a system call within python 3.2 to python 2.7 and run a script like that.
There isnt too much to be moved around so its okay as a temporary workaround.