OpenCV连续显示类似视频一样

cv::VideoCapture video = VideoCapture();
video.open("D:\\Temp\\Videos\\黄原胶.mp4");//读取视频
if (!video.isOpened()) {
printf("could not read this video file...\n");
return -1;
}
Mat frame;
namedWindow("Video", WINDOW_AUTOSIZE);
while (video.read(frame)) {
ObstacleDetection od;
frame = od.GetObstacle(frame);//图片处理

cv::imshow("Video", frame);
cv::waitKey(1);//显示等待时间
}

posted @ 2023-02-13 16:21  爱编程的顺  阅读(69)  评论(0)    收藏  举报