这个简单的程序在 VideoCapture 上崩溃了。我的配置是 OpenCV 2.0、MinGW、Windows7
int main()
{
cout<<"reached here"<<endl;
VideoCapture cap;
cap.open("Z:\\snapshot\\streaminput\\video1.avi");
if (!cap.isOpened())
{
cout<<"capture failed"<<endl;
// print error msg
return -1;
}
cout<<"capture successful"<<endl;
Mat frame;
namedWindow("gray",1);
do
{
cap >> frame;
cout<<"got a frame"<<endl;
imshow("gray", frame);
cvWaitKey(300);
}while(1);
//cvDestroyAllWindows();
cout << "Hello world!" << endl;
return 0;
}
CALLSTACK:
#0 002FB4B8 cv::VideoCapture::VideoCapture(int) ()(C:\OpenCV2.0\bin\libhighgui200.dll:??)
#1 77CCE115 ntdll!RtlAllocateMemoryZone() (C:\Windows\system32\ntdll.dll:??)
#2 00000000 0x0022fe78 in ??() (??:??)
PROGRAMOUTPUT(BEFORE CRASH POINT):
capture name is:Z:\snapshot\streaminput\video1.avi
Process returned 255 (0xFF) execution time : 9.874
Press any key to continue.
知道这个程序或配置有什么问题吗?