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);//显示等待时间
}
浙公网安备 33010602011771号