kujira70 / pythonxy

Automatically exported from code.google.com/p/pythonxy
0 stars 0 forks source link

opencv import adaptors fails saying it needs Numeric library #95

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
First, just wanted to say thanks to everyone who has put together Pythonxy.
 It's a great system!

What steps will reproduce the problem?
1. from opencv import adaptors

What is the expected output? 
that the import would succeed

What do you see instead?

ImportError: No module named Numeric

In [6]: from opencv import adaptors
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

C:\Documents and Settings\Owner\My Documents\Python\<ipython console> in
<module>()

C:\Program Files\pythonxy\python\lib\site-packages\opencv\adaptors.py in
<module>()
     64 import PIL
     65 import PIL.Image
---> 66 import Numeric
     67
     68
###########################################################################

ImportError: No module named Numeric

What version of the product are you using? Python(x,y) 2.1.5 full edition

On what operating system? Windows XP

Please provide any additional information below.
The latest version of OpenCV on SourceForge appears to have this issue
resolved by importing NumPy instead of Numerics in adaptors.py

Original issue reported on code.google.com by potto%ie...@gtempaccount.com on 5 May 2009 at 1:53

GoogleCodeExporter commented 9 years ago
Thanks for the feedback.
Apparently this version of opencv is outdated...
But I don't have the time to build a new package with a more recent version of 
OpenCV 
(they used to release Python 2.5 binaries but now they have already switch to 
Python 
2.6). I'm thinking of using opencv-ctypes module instead:
http://code.google.com/p/ctypes-opencv/
Are you familiar with it?

Original comment by pierre.raybaut on 23 Jul 2009 at 9:11

GoogleCodeExporter commented 9 years ago
I am somewhat familiar with it.  If there is any way I can help let me know!

Original comment by potto%ie...@gtempaccount.com on 24 Jul 2009 at 2:11

GoogleCodeExporter commented 9 years ago
Yes, you can help, thanks for proposing. Before making the Python(x,y) plugin, 
one 
has to test the module and to check for its Python or external dependencies. In 
this 
case, I would really like to know first if it works (you may try out the demos) 
and 
second what is needed to make it work (i.e. what OpenCV binary release? and how 
to 
get it?).

Once these two points are done, I may be able to make a plugin and replace the 
current OpenCV plugin.

Thanks!
Pierre

Original comment by pierre.raybaut on 24 Jul 2009 at 5:47

GoogleCodeExporter commented 9 years ago
It appears some success.  I have been able to run part of a script that did the
chessboard detection.  Here is what I have done:

--Setup main code--
1. Downloaded ctypes-opencv-0.8.0.win32-py25.exe from 
http://code.google.com/p/ctypes-opencv/
2. It created C:\Program Files\pythonxy\python\Lib\site-packages\ctypes_opencv
3. I created a temporary path to the module with sys.path.append(r'C:\Program
Files\pythonxy\python\Lib\site-packages\')

--Setup Demo code--
4. Installed http://www.fileinfo.com/extension/7z so could decompress the 7z 
format
for the demo code
5. Downloaded the demo code ctypes-opencv-0.8.0-demo.7z and installed in in My 
Documents

--Ran from Pydee which worked--
from ctypes_opencv import *
import sys

cvNamedWindow("win")
filename = 'chess2.jpg'
im = cvLoadImage(filename, CV_LOAD_IMAGE_GRAYSCALE)
im3 = cvLoadImage(filename, CV_LOAD_IMAGE_COLOR)
chessboard_dim = cvSize( 7, 5 )
found, corners = cvFindChessboardCorners( im, chessboard_dim )
cvDrawChessboardCorners( im3, chessboard_dim, corners, found )

cvShowImage("win", im3);

--Future--
Plan to do more testing with camera and other code.

Original comment by potto%ie...@gtempaccount.com on 29 Jul 2009 at 2:00

GoogleCodeExporter commented 9 years ago
Fixed with opencv 2.0wr1.1.0

Original comment by pierre.raybaut on 29 Mar 2010 at 2:52