求大神帮忙改,就是简单的Opencv的视频读取,就是闪一下现实不出来,代码没有错误,视频解码器装了也没用 30
#include"highgui.h"intmain(intargc,char*argv[]){cvNamedWindow("avi");CvCapture*captur...
#include "highgui.h"
int main(int argc, char* argv[])
{
cvNamedWindow("avi");
CvCapture* capture = cvCreateFileCapture("C:\\Users\\Administrator\\Desktop\\毕设所用视频\\1.avi");
//CvCapture* capture = cvCreateCameraCapture(-1);
IplImage* frame;
while(1)
{
frame = cvQueryFrame(capture);
if (!frame)
{
break;
}
cvShowImage("avi",frame);
char c = cvWaitKey(33);
if (c == 27)
{
break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("avi");
}
return 0;
} 展开
int main(int argc, char* argv[])
{
cvNamedWindow("avi");
CvCapture* capture = cvCreateFileCapture("C:\\Users\\Administrator\\Desktop\\毕设所用视频\\1.avi");
//CvCapture* capture = cvCreateCameraCapture(-1);
IplImage* frame;
while(1)
{
frame = cvQueryFrame(capture);
if (!frame)
{
break;
}
cvShowImage("avi",frame);
char c = cvWaitKey(33);
if (c == 27)
{
break;
}
cvReleaseCapture(&capture);
cvDestroyWindow("avi");
}
return 0;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询