Open TaikiY04 opened 3 years ago
Just check if your IDE is able to access your webcam by using print(video_capture.isOpened())
after video_capture = cv2.VideoCapture(0)
. If it's False than go to your Security and Privacy->Camera and enable camera access for your IDE. Hope this works!!!
https://stackoverflow.com/questions/61979361/cannot-turn-on-mac-webcam-through-opencv-python
I was facing this issue, after searching for sometime, figured it out, it is due to camera permission issue (exact error code: Abort 6
). Also, as stated in many answers, I could not enable permission to access camera from vs code. There are some hacks, but I think, none of it works in Catalina, like editing access table using sqlite, etc.
The only solution which works as of now is run vs code as root sudo code
, it will show warnings, but you can ignore and continue in your laptop.
Again, with this method, there are some other issues related to Python Virtual Environment - but it is different issue, need to discuss in related thread.
I finally fixed the problem on my laptop! The RBG does not get converted correctly in the while loop,
Replace: rgb_small_frame = small_frame[:, :, ::-1]
with: rgb_small_frame = cv2.cvtColor(small_frame, cv2.COLOR_BGR2RGB)
I finally fixed the problem on my laptop! The RBG does not get converted correctly in the while loop,
Replace:
rgb_small_frame = small_frame[:, :, ::-1]
with:
rgb_small_frame = cv2.cvtColor(small_frame, cv2.COLOR_BGR2RGB)
This is the solution, Thanks buddy!
Description
I am trying to just run the face recognition from the camera fast version, to see if it even works for me.
What I Did
I used the code already given and when I run it Python unexpectedly quits. This seems like an issue with the Mac not allowing the opencv to use the webcam. I do not know how to give permission though. Please help.