嗨所以我写了这段代码来捕获文件中的视频
#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);
}
Run Code Online (Sandbox Code Playgroud)
每次我运行它,我都会收到以下错误:
CaptureVideo.cpp:在函数'int main(int,char**)'中:
CaptureVideo.cpp:13:28:错误:在'char'之前预期的primary-expression
任何帮助都感激不尽.
我正在尝试比较输入值.这是我想说的样本.
if(text.input != float)
{
//code to calculate
}
Run Code Online (Sandbox Code Playgroud)
我不想允许输入数字以外的值.它是否正确?