added app3.py and coba.py

This commit is contained in:
Naufalakram
2023-09-29 18:06:50 +08:00
parent d27a591c47
commit 7a6ce35ef2
4 changed files with 65 additions and 1 deletions

19
coba.py Executable file
View File

@ -0,0 +1,19 @@
import cv2
# Initialize the webcam
video_capture = cv2.VideoCapture(-1)
while True:
# Capture a single frame from the webcam
ret, frame = video_capture.read()
# Display the resulting image
cv2.imshow('Video', frame)
# Exit the loop if the 'q' key is pressed
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# Release the webcam and close all windows
video_capture.release()
cv2.destroyAllWindows()