summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-05-07 16:13:18 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-05-07 16:13:18 +0530
commit080e44ccb561475e9b288d045f3de678ce89ea54 (patch)
treeddd15c972521e5cd788317b7bde8ba8303c076be
parent67201b046b3febb1ec0d5dd732eda0126ee51eaa (diff)
CamTest: Updating the comments
-rw-r--r--CamTest.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/CamTest.py b/CamTest.py
index 01d159c..e52b754 100644
--- a/CamTest.py
+++ b/CamTest.py
@@ -1,9 +1,10 @@
import cv2
from picamera2 import Picamera2
-# Setting the video capture source to default (0)
+
+# Create an instance of the PiCamera2 object
cam = Picamera2()
-# Setting the resolution of the video capture
+# Set the resolution of the camera preview
cam.preview_configuration.main.size = (1280,720)
cam.preview_configuration.main.format = "RGB888"
cam.preview_configuration.align()
@@ -12,7 +13,7 @@ cam.start()
# While loop to continuously capture frames from camera
while True:
- # Read a frame from the camera
+ # Capture a frame from the camera
frame=cam.capture_array()
# Convert frame from BGR to grayscale
@@ -24,6 +25,7 @@ while True:
# Wait for 30 milliseconds for a key event (extract sigfigs) and exit if 'ESC' or 'q' is pressed
key = cv2.waitKey(30) & 0xff
+ #Checking keycode
if key == 27: # ESCAPE key
break
elif key == 113: # q key