raspberry-pi-absensi/app.py

19 lines
404 B
Python
Raw Normal View History

2023-09-24 13:34:10 +00:00
import cv2
# Open a video capture object
cap = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Display the resulting frame
cv2.imshow('frame',frame)
# Break the loop on 'q' key press
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture and destroy the window
cap.release()
2023-09-24 13:34:10 +00:00
cv2.destroyAllWindows()