Ask Your Question

blimp555's profile - activity

2017-11-18 09:21:05 -0600 received badge  Notable Question (source)
2014-10-05 15:48:27 -0600 received badge  Popular Question (source)
2013-01-09 18:14:53 -0600 received badge  Student (source)
2012-09-25 13:59:06 -0600 commented question Video capture issue in python

I just tried and am not having any luck. I've tried this on two Windows7 64 bit machines, and I get the same error on both: cv2.imshow('some', img) error: ......\src\opencv\modules\core\src\array.cpp:2482: error: (-206) Unrecognized or unsupported array type

I installed Python 2.7.2 and opencv 2.4.2 on both machines. Is there something I'm doing wrong with the installation? Should I try a different version of opencv? Any suggestions would be helpful. Thanks!

2012-09-20 11:41:42 -0600 asked a question Video capture issue in python

I am having trouble with the following simple code snippet:

import cv2.cv as cv
capture = cv.CaptureFromFile('C://video.mp4') 
frame = cv.QueryFrame(capture)
frame_size = cv.GetSize(frame)

cv.GetSize gives this error:

error: Array should be CvMat or IplImage

frame is of type <type 'nonetype'="">, so QueryFrame is not returning properly. capture seems to be ok. It is type <type 'cv2.capture'=""> and has a valid looking value: <capture 03673420="">.

Here are the details of my setup: Python 2.7.3, OpenCV 2.4.2, OS = Windows 7.

I can view the video.mp4 file in windows media player. I can open jpg files successfully with:

frame = cv.LoadImageM('C://test.jpg',cv.CV_LOAD_IMAGE_COLOR);

Whatever I do, I haven't been able to open video files with OpenCV. Any suggestions?