opencv 的videocapture类的read函数无法读取视频帧
int _tmain(int argc, _TCHAR* argv[])
{
VideoCapture cap("F://00287.avi");
if (!cap.isOpened())
{
cout<<"fail";
return 1;
}
double rate=cap.get(CV_CAP_PROP_FPS);
bool stop(false);
Mat frame;
namedWindow("1");
int delay=1000/rate;
while(!stop)
{
cap>>frame;
imshow("1",frame);
if(waitKey(delay)>=0)
stop=true;
}
cap.release();
return 0;
}
每次都cap>>frame;
这里就中断est.exe 中的 0x77c16fa3 处有未经处理的异常: 0xC0000005: 读取位置 0x00fb1da0 时发生访问冲突。。。求破!!!!