Error message when I try to run this code [closed]
these error message : OpenCV: Cannot use FaceTime HD Camera (Built-in) OpenCV: camera failed to properly initialize!
code: import cv2 as cv import numpy as np
cap = cv.VideoCapture(0)
while True: ret, frame = cap.read() cv.imshow('frame', frame) if cv.waitKey(1) & 0xFF == ord('q'): break
cap.release() cv.destroyAllWindows()
macOS Mojave
Go to System Preferences -> Security & Privacy -> camera -> tick the box for Terminal