Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can i get OpenCV for python?

Tags:

python

opencv

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

like image 658
appusajeev Avatar asked Jan 31 '10 17:01

appusajeev


3 Answers

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 *
like image 162
mipata Avatar answered Oct 16 '22 20:10

mipata


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:

  • PyOpenCV
  • Scikits Image
  • Ctypes OpenCV
  • SWIG OpenCV

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.

like image 31
whatnick Avatar answered Oct 16 '22 20:10

whatnick


get it from here unofficial binary packages.

by the way, they provide unofficial packages for many other projects

like image 2
tovmeod Avatar answered Oct 16 '22 22:10

tovmeod