OpenCV 2.0 and Python

Posted by Jive Dadson on Stack Overflow See other posts from Stack Overflow or by Jive Dadson
Published on 2010-02-03T21:07:04Z Indexed on 2010/03/09 1:21 UTC
Read the original article Hit count: 534

Filed under:
|

I cannot get the example Python programs to run. When executing the Python command "from opencv import cv" I get the message "ImportError: No module named _cv". There is a stale _cv.pyd in the site-packages directory, but no _cv.py anywhere. See step 5 below.

MS Windows XP, VC++ 2008, Python 2.6, OpenCV 2.0

Here's what I have done.

  1. Downloaded and ran the MS Windows installer for OpenCV2.0.
  2. Downloaded and installed CMake
  3. Downloaded and installed SWIG
  4. Ran CMake. After unchecking "ENABLE_OPENMP" in the CMake GUI, I was able to build OpenCV using INSTALL.vcproj and BUILD_ALL.vcproj. I do not know what the difference is, so I built everything under both of those project files. The C example programs run fine.
  5. Copied contents of OpenCV2.0/Python2.6/lib/site-packages to my installed Python2.6/lib/site-packages directory. I notice that it contains an old _cv.pyd and an old libcv.dll.a.

© Stack Overflow or respective owner

Related posts about opencv

Related posts about python