简体   繁体   中英

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 such file (minidemo.py) and I run it. As a result I got the same problem as described above.

opencv上的Python已更改, 请在此处确保已安装最新的opencv-您可能还需要numpy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM