/Accessing-Webcam

Web Cam access and video recording

Primary LanguageC++

Accessing Webcam

Libraries

     import cv2
     import numpy

Dive in

     cap = cv2.VideoCapture(0)  

cv2.VideoCapture(0) function helps us to accessing web-cam.

     while(True):
         ret, cam = cap.read() 

.read() function helps us to read the frames from web-cam

         cv2.imshow('video',cam) 

cv2.imshow() function helps to show collected frames at terminal.It takes two args 1-'name of the file/folder' for prresentation,2-variale name at which frames are collected.

         if cv2.waitKey(1) == ord('q'): 
             break
         
     print("Web-Cam Released")

     cv2.destroyAllWindows()
     cap.release()