Introduction: Using OpenCV 1.0 With Python 2.5 in Windows XP

About: Twitter: @mindsforge

I had a hard time getting openCV(open Computer Vision, by Intel) working with python 2.5, here are instructions and files on how to get this working easily!

We will assume you have python 2.5 installed (from the link above) I will walk through the now fairly straight forward openCV installation process.

ABOUT OPENCV:
"The Open Computer Vision Library is a collection of algorithms and sample code for various computer vision problems."
Basically it has a bunch of tools that let you analyze picture files and live video from a source such as a webcam. I am currently working on a robot for defcon 15.

Step 1: Navigate Your Directories

Find out where you have python installed, it is by default C:\Python25\

Once you are there look for 'Lib', inside Lib there should be another directory called 'site-packages'
On this computer I have no other packages installed for python, so it is empty besides a README.txt

Step 2: Copy the Compiled Python Modules Into Site-packages

Just download the file, unzip and copy the entire /opencv/ directory directly to /site-packages/

as shown in the screenshot...

I compiled the python modules in MSVS 2003 so it works with python 2.5, I am not sure about other versions of python, but it seems like if you compile the python modules in anything besides MSVS 2003, it chokes and dies.

Step 3: Now You Should Be Set

To make sure opencv is working well with python navigate to where you installed opencv "C:\Program Files\OpenCV" for me...

Now, samples, then python, and you should be presented with a codeucopia* of example files... a good test file that requires no video input to test the module is working correctly is 'drawing.py'

*made up word

P.S.
If you were only interested in using opencv with python, there is no real reason to install from the original installer besides access to the samples.

Good luck and happy visions!