嗨所以我写了这段代码来从文件中捕获视频
#include <stdio.h>
#include <cv.h>
#include "highgui.h"
#include <iostream>
//using namespace cv
int main(int argc, char** argv)
{
CvCapture* capture=0;
IplImage* frame=0;
capture = cvCaptureFromAVI(char const* filename); // read AVI video
if( !capture )
throw "Error when reading steam_avi";
cvNamedWindow( "w", 1);
for( ; ; )
{
frame = cvQueryFrame( capture );
if(!frame)
break;
cvShowImage("w", frame);
}
cvWaitKey(0); // key press to close window
cvDestroyWindow("w");
cvReleaseImage(&frame);
}
每次我运行它,我都会收到以下错误:
CaptureVideo.cpp:在函数'int main(int,char**)'中:
CaptureVideo.cpp:13:28:错误:“char”之前的预期主表达式</p>
任何帮助都感激不尽。