string avi_name = ConvertDirectToString(direct) + "0809.avi";//打开视频文件:建立一个VideoCapture结构VideoCapture cap(avi_name.c_str());//检测是否正常打开:成功打开时,isOpened返回tureif (!cap.isOpened())cout << "fail to open!" << endl;int Frames_AVI = cap.get(CAP_PROP_FRAME_COUNT); Mat Img;for (int Frame_Index = 2; Frame_Index < Frames_AVI; Frame_Index++){ Img.setTo(Scalar(0, 0, 0));cap.read(Img);imshow("Image", Img);waitKey(1);}
OpenCV读取AVI帧至Mat
最新推荐文章于 2022-07-03 17:14:19 发布