import cv2
import numpy as np
def main():
cap = cv2.VideoCapture("C:/Users/wei/Desktop/Testvideo/左侧三人越界.mp4")
i = 0
while True:
is_opened, frame = cap.read()
try:
print(frame.shape)
except Exception as e:
continue
save_path = 'F:/vedioimg/'
cv2.imwrite(save_path+str(i)+'.jpg', frame)
i =i+1
if __name__ == '__main__':
main()
视频转图片
最新推荐文章于 2024-07-05 21:32:30 发布