From 58ce271262e6373b72e0b7c35ab550997b714e77 Mon Sep 17 00:00:00 2001 From: Sourab Maity <62734958+sourabmaity@users.noreply.github.com> Date: Tue, 3 Oct 2023 07:57:44 +0530 Subject: [PATCH] Create videoCapture.py --- sourabmaity/videoCapture.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sourabmaity/videoCapture.py diff --git a/sourabmaity/videoCapture.py b/sourabmaity/videoCapture.py new file mode 100644 index 0000000..621aacd --- /dev/null +++ b/sourabmaity/videoCapture.py @@ -0,0 +1,25 @@ +import cv2 + + +# define a video capture object +vid = cv2.VideoCapture(0) + +while(True): + + # Capture the video frame + # by frame + ret, frame = vid.read() + + # Display the resulting frame + cv2.imshow('frame', frame) + + # the 'q' button is set as the + # quitting button you may use any + # desired button of your choice + if cv2.waitKey(1) & 0xFF == ord('q'): + break + +# After the loop release the cap object +vid.release() +# Destroy all the windows +cv2.destroyAllWindows()