Where can i get OpenCV for python?


Question

Where can i get OpenCV for python?What are the pre-requisites?? i tried to install opencv-python through synaptic package manager but Python says

No module named CVtypes

1
7
1/31/2010 5:20:57 PM

Accepted Answer

CVTypes is a third party implementation that essentially wraps python around objects written in C, the language that OpenCV is written in (along with C++). If you want to use that, you will have to download and install it separately, as it is not part of the standard repositories of Ubuntu's Synaptic package manager that I know of at this time (I assume you are on Ubuntu because you mentioned 'Synaptic', Ubuntu's package manager).

However, there is an official python interface for OpenCV that is included in the OpenCV SVN repository and build packages. When installing version 1.0 from the package manager in Ubuntu, the python modules will be installed in the following directory:

/usr/lib/pymodules/python2.6/opencv

Ensure that is part of your PYTHONPATH environment variable and you should be able to import the modules as such:

from opencv.cv import *
from opencv.highgui import *
5
2/4/2010 7:43:07 PM

OpenCV over time has accumulated numerous Python bindings, mostly due to the strange way arrays are represented in OpenCV (IMHO). Here is a short list:

Choose which one you want to use and keep it consistent and upto date. I personally prefer the classic WillowGarage version[listed last] over its fancier cousins since it has most development and test muscle behind it.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon