summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-05-05 19:49:17 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-05-05 19:49:17 +0530
commit88b5c1a804a583b88c6f65cfbf02e5f4c0935f29 (patch)
treea74c86c2f928ba256ac4a176f2c27cc890d6308f
parent36c09e2d4d7ca45d47906f38adf9d370a2d5db94 (diff)
CamTest: fixing typos
-rw-r--r--CamTest.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/CamTest.py b/CamTest.py
index 3b197e5..8544116 100644
--- a/CamTest.py
+++ b/CamTest.py
@@ -1,12 +1,14 @@
import cv2
+
# Setting the video capture source to default (0)
cap = cv2.VideoCapture(0)
+
# Setting the resolution of the video capture
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
# While loop to continuously capture frames from camera
-while(True):
+while True:
# Read a frame from the camera
ret, frame = cap.read()
#frame = cv2.flip(frame, -1) # Flip camera vertically
@@ -18,11 +20,11 @@ while(True):
cv2.imshow('Grayscale', gray)
# Wait for 30 milliseconds for a key event (extract sigfigs) and exit if 'ESC' or 'q' is pressed
- k = cv2.waitKey(30) & 0xff
- if key == 27: # ESCAPE key
+ key = cv2.waitKey(30) & 0xff
+ if key == 27: # ESCAPE key
+ break
+ elif key == 113: # q key
break
- elif key == 113 # q key
- break
# Release the camera and close all windows
cap.release()