Answers for "access camera using python"

1

accessing camera with python

import cv2

vid = cv2.VideoCapture(0)

while True:

    ret, frame = vid.read()

    cv2.imshow('Controlling my computer camera', frame)

    if cv2.waitKey(4) & 0xFF == ord('q'):
        break


vid.release()
cv2.destroyAllWindows()
Posted by: Guest on June-30-2021
0

how to show webcam in opencv

import cv2

cap = cv2.VideoCapture(0)

while True:
    success, img = cap.read()
    cv2.imshow("Webcam", img)
    if cv2.waitKey(1) == ord('q'):
        break
Posted by: Guest on December-11-2020

Python Answers by Framework

Browse Popular Code Answers by Language