Initial commit
This commit is contained in:
25
capture.py
Executable file
25
capture.py
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import cv2
|
||||
import sys
|
||||
|
||||
cap = cv2.VideoCapture(0)
|
||||
cap.set(3, 1280)
|
||||
cap.set(4, 720)
|
||||
cap.set(cv2.CAP_PROP_FPS, 30) # Setze die Framerate auf 30 fps
|
||||
|
||||
print("Starting")
|
||||
|
||||
doSave = 0
|
||||
while True:
|
||||
ret, frame = cap.read()
|
||||
#cv2.imshow('frame', frame)
|
||||
|
||||
# Speichern des Frames als JPEG-Bild
|
||||
file_name = f'./temp/picture.jpg'
|
||||
cv2.imwrite(file_name, frame)
|
||||
print("wrote_frame")
|
||||
sys.stdout.flush() # Leere den Ausgabepuffer
|
||||
|
||||
cap.release()
|
||||
cv2.destroyAllWindows()
|
Reference in New Issue
Block a user