You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To create a python script which is open webcam we will need to import a cv2 module.
OpenCV is a vast library that helps in providing various functions for image and video operations.
So, the process is something like that the user will run the program and it will open the web cam and after clicking on a button it will shutdown the program.
Procedure:
importcv2
First after importing modules.
Use cv2.VideoCapture() to get a video capture object for the camera.
Set up an infinite while loop and use the read() method to read the frames using the above created object.
Use cv2.imshow() method to show the frames in the video.
Breaks the loop when the user clicks a specific key.