Video io, 'get' not working with OpenCv

robbert superslimme at netscape.net
Sat Dec 17 10:50:58 EST 2011


Hi All,

I've wrote a little test program to a extract a frame of a video file 
(for processing), but I can't get it work.
The video file is a compressed avi file, and can be played by the 
camshift.py demo of OpenCv.
So I think the OpenCv bindings for python are installed correctly.

import skimage
from skimage.io import Video
vid = Video('c:\\test.avi')
frame0 = vid.get()

However the above test program gives the following error:

Traceback (most recent call last):
   File "C:\prog\skimage-test.py", line 8, in <module>
     frame0 = vid.get()
   File 
"C:\Python\lib\site-packages\scikits_image-0.4.2-py2.6-win32.egg\skimage\io\video.py", 
line 279, in get
     return self.video.get()
   File 
"C:\Python\lib\site-packages\scikits_image-0.4.2-py2.6-win32.egg\skimage\io\video.py", 
line 54, in get
     cv.Copy(img, img_mat)
TypeError: CvArr argument 'dst' must be IplImage, CvMat or CvMatND. Use 
fromarray() to convert numpy arrays to CvMat or cvMatND

I used the following versions of the software
Python 2.6.4
Numpy 1.6.1
Scipy 0.9.0
skimage 0.4.2
OpenCv  2.3.1    (Rev: 4557)
PyQt 4.6.2
WinXp Sp3

Am I doing something wrong? Or is there just a specific version of 
OpenCv required?
Note that OpenCv isn't on the (optional) requirements list.

I also tried to install the alternative backend, gstreamer+python 
bindings, but under windows this seems to be troublesome.


kind regards,

Robbert




More information about the scikit-image mailing list