OpenCV with Python (cv or cv2)

IronManMark20 mr.smittye at gmail.com
Wed May 27 00:54:27 EDT 2015


On Tuesday, May 26, 2015 at 6:52:00 AM UTC-7, Markos wrote:
> Hi,
> 
> I want to use OpenCV with Python.
> 
> I installed version 2.4.9 
> (http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/) 
> in debian Squeeze running Python 2.6.6. Using the tutorial: 
> http://indranilsinharoy.com/2012/11/01/installing-opencv-on-linux/
> 
> (I tried to install versions 2.4.11 and 2.4.10 (in Squeeze with python 
> 2.2.6) but I couldn't.)
> 
> I lost some time trying to load the module cv2:
> 
> > >> Import cv2.cv the cv
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module >>
> ImportError: No module named cv2.cv
> 
> After a while I realized I could use the cv module. (import cv)
> 
> But still I do not understand the differences between the modules cv and 
> cv2.
> 
> Do you suggest any good tutorial about the differences between cv and cv2?
> 
> I will have to make many changes in python programs using cv to reuse 
> the code later with cv2?
> 
> Thanks,
> Markos

To actually answer your questions, cv2 is the newest and best opencv binding. It uses numpy arrays, instead of what cv uses. This means it is much easier to deal with. I will also point you to https://stackoverflow.com/questions/10417108/what-is-different-between-all-these-opencv-python-interfaces



More information about the Python-list mailing list