I wrapped opencv today using the simplecv python interface. After going through the official SimpleCV Cookbook, I was able to successfully Download, Save, and Manipulate images. This way, I know that the library is loading properly.
However, in the Using Camera, Kinect, or Virtual Camera section of the heading, I was not successful in executing some of the commands. In particular, mycam = Camera() worked, but img = mycam.getImage() produced the following error:
In [35]: img = mycam.getImage().save() OpenCV Error: Bad argument (Array should be CvMat or IplImage) in cvGetSize, file /home/jordan/OpenCV-2.2.0/modules/core/src/array.cpp, line 1237 --------------------------------------------------------------------------- error Traceback (most recent call last) /home/simplecv/<ipython console> in <module>() /usr/local/lib/python2.7/dist-packages/SimpleCV-1.1-py2.7.egg/SimpleCV/Camera.pyc in getImage(self) 332 333 frame = cv.RetrieveFrame(self.capture) --> 334 newimg = cv.CreateImage(cv.GetSize(frame), cv.IPL_DEPTH_8U, 3) 335 cv.Copy(frame, newimg) 336 return Image(newimg, self) error: Array should be CvMat or IplImage
I am running Ubuntu Natty on an HP TX2500 tablet. Does it have a built-in webcam (CyberLink Youcam?) Has anyone seen this error before? Today I was on the Internet looking for a solution, but it does nothing of the kind.
Update 1 . I tested cv.QueryFrame (capture) with the code found here in a separate stack overflow question , and it worked; so I pretty nailed it to the webcam problem.
Update 2 . In fact, I get exactly the same errors on a machine that doesn't even have a webcam! It looks like the TX2500 is not compatible ...
source share