mirror of
https://github.com/NohamR/Stage-2023.git
synced 2025-05-24 14:21:58 +00:00
29 lines
502 B
Python
29 lines
502 B
Python
import os
|
|
import pandas as pd
|
|
import numpy as np
|
|
import cv2
|
|
import time
|
|
|
|
cap = cv2.VideoCapture('cams/new/cut1.mp4')
|
|
folder_path = "cams/new/frames"
|
|
|
|
frame_nb = 0
|
|
|
|
if (cap.isOpened()== False):
|
|
print("Error opening video stream or file")
|
|
while(cap.isOpened()):
|
|
|
|
ret, frame = cap.read()
|
|
if ret == True:
|
|
|
|
if frame_nb == 300:
|
|
cv2.imwrite('frame.png', frame)
|
|
|
|
frame_nb = frame_nb + 1
|
|
|
|
else:
|
|
break
|
|
|
|
print(frame_nb)
|
|
cap.release()
|
|
cv2.destroyAllWindows() |