#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
VideoCapture capture("FireWing_Alpha.mov");
if(!capture.isOpened())
cout<<"fail to open!"<<endl;
int frames=capture.get(CV_CAP_PROP_FRAME_COUNT);
int n=0;
while(1)
{
Mat frame;
capture>>frame;
resize(frame,frame,Size(640,480));
if (n==frames-1)
{
capture.set(CV_CAP_PROP_POS_FRAMES,0);
}
imshow("read",frame);
n++;
waitKey(30);
}
return 0;
}
OPENCV循环显示视频
最新推荐文章于 2023-12-18 18:23:19 发布