开发者

Why python.exe stopped working?

I try to use OpenCV for Python. I have just two lines of the code:

import cv
capture = cv.CreateFileCapture('test.avi')

If I run this code from the command line, Windows creates a window with the following message:

python.exe stopped working
A problem caused the program to stop working correctly.
Windows will close the program and notify you if a solution is available.

What can be the a reason of that?


I would like to add some details. Not sure if they are relevant. In the examples that I found people use cvCreateFileCapture instead of cv.CreateFileCapture. But in this case my program generate a NameError (cvCreateFileCapture is not found).

In general I was able to do a simple stuff with the OpenCV (so, it is installed and it works). For example I was able to change format of an image:

import cv
im = cv.LoadImageM("test.jpg")
print type(im)
cv.SaveImage("test.png", im)

ADDED

"In OpenCV2.2\samples\python" I found many *.py samples. I run some of them and they work fine (I see some animation and so on). The I tried to find a file that contains "CreateFileCapture". I found only one suc开发者_运维知识库h file (minidemo.py) and I run it. As a result I got the same problem as described above.


Python on opencv has changed, see here make sure you have the latest opencv install - you might also need numpy

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜