diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2023-05-07 16:13:18 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2023-05-07 16:13:18 +0530 |
commit | 080e44ccb561475e9b288d045f3de678ce89ea54 (patch) | |
tree | ddd15c972521e5cd788317b7bde8ba8303c076be | |
parent | 67201b046b3febb1ec0d5dd732eda0126ee51eaa (diff) |
CamTest: Updating the comments
-rw-r--r-- | CamTest.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |