Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.

Create videoCapture.py #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions sourabmaity/videoCapture.py
Original file line number Diff line number Diff line change
@@ -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()