import CV and newer OpenCV versions

200 views
Skip to first unread message

Xaffeine

unread,
Nov 25, 2013, 6:00:03 PM11/25/13
to pyvi...@googlegroups.com
I am having trouble getting started with pyvision because the code has a lot of "import cv" statements and I am using OpenCV 2.4.3 or newer. Import cv does not work in recent versions of OpenCV; you have to use something like "import cv2.cv as cv".

My workaround is to create a python module in src/cv.py containing the statement "from cv2.cv import *". This eliminates at least the most obvious errors, but I haven't gotten far yet in my testing.

I understand that OpenCV is planning to eliminate the pre-cv2 interfaces, so I am worried that this might become a bigger problem. Does anyone have a recommendation on what should be done?

David Bolme

unread,
Dec 15, 2013, 11:16:49 AM12/15/13
to pyvi...@googlegroups.com
This is  a known issue as opencv transitions to the cv2 interface.  Most new pyvision code uses the cv2 module and I am trying to convert some of the legacy code to use the cv2 interface as I encounter problems.  There is still a lot of legacy code that uses the cv interface.  On most systems a module called cv.py is installed along side the cv2.so module that basically contains something like:

from cv2.cv import *

However I have seen this missing in some windows distributions.  It is an easy fix.  

Within pyvision I have tried to convert many of the imports to something like "import cv2.cv as cv".

---
Dave

--
 
---
You received this message because you are subscribed to the Google Groups "pyvision" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyvision+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages