#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
using namespace cv;
int main( )
{
VideoCapture cap("/path/to/Videos/华农兄弟:兄弟俩去摘野果.mp4");
if(!cap.isOpened())
{
return -1;
}
Mat frame;
//循环读取显示视频的每一帧
while(1)
{
cap>>frame;
if(frame.empty()) break;
imshow("当前视频",frame);
if(waitKey(30) >=0)
break;
}
return 0;
}
opencv读取本地视频
最新推荐文章于 2024-06-26 18:20:32 发布