Error message when I try to run this code [closed]

asked 2018-11-07 11:58:52 -0600

updated 2018-11-07 12:09:37 -0600

berak gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2018-11-07 12:09:01.746948

Comments

Go to System Preferences -> Security & Privacy -> camera -> tick the box for Terminal

leermeester gravatar imageleermeester ( 2019-03-26 03:22:01 -0600 )edit