import numpy as np
import cv2 as cv
# 1获取视频对象
cap = cv.VideoCapture('./image/nice.mp4')
# 2.判断是否读取成功
while cap.isOpened():
# 3.获取每一帧图像
ret, frame = cap.read()
# 4.获取成功显示图像
if ret:
cv.imshow('frame', frame)
# 5.每一帧间隔为25ms
if cv.waitKey(25) & 0xFF == ord('q'):
break
# 6释放视频对象
cap.release()
cv.destoryAllwindows()
)
THE END
暂无评论内容