刚刚接触OpenCV,运行了书上的例程,程序编译没有问题,在视频显示快要结束时遇到了下面的问题,代码在后面

用OpenCV显示视频时遇到问题

#include "stdafx.h"
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\video\tracking.hpp>
using namespace cv;
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
//读入视频
VideoCapture capture("111.avi");

//循环显示每一帧
while(1)
{
Mat frame;//定义一个Mat变量,用于存储每一帧的图像
capture>>frame;//读取当前帧
imshow("读取视频",frame);//显示当前帧
waitKey(10);//延时30ms
}
return 0;
}

相关文章:

  • 2021-04-12
  • 2021-05-04
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2022-01-02
  • 2021-12-15
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-01-01
相关资源
相似解决方案