#include "mainwindow.h"
#include <QApplication>
#include "opencv2/opencv.hpp"
#include <iostream>
#include <QDebug>
using namespace cv;
using namespace std;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
/*Mat color=imread("E:/QTimage/2.jpg");
imshow("color",color);
Mat edge,grayImage;
cvtColor(color,grayImage,CV_BGR2GRAY);
blur(grayImage,edge,Size(3,3));
Canny(edge,edge,3,9,3);
imshow("2",edge);*/
VideoCapture capture("E:/QTprogram/021403/0.mp4");//视频格式随意
int i=0;
while(1)
{
Mat frame;
capture>>frame;
qDebug()<<"bofang"<<i;//判断播放帧数
i++;
if(frame.empty())
{
qDebug()<<"stop";
break;
}
imshow("shipin",frame);
waitKey(30);
}
return a.exec();
//return 0;
}标签:qt,color,frame,imshow,opencv,int,edge,include,读取 From: https://www.cnblogs.com/dq0618/p/17124833.html