简体   繁体   中英

zsh:abort when trying to run webcam using opencv on visual studio code on mac

I was getting an error like this, I solved it so, I thought I could help as I could not find much in web as to how to solve.

So, Visual studio cannot access your webcam on mac due to permission therefore opencv.VideoCapture(0) does not work

So, if u try to run opencv (if it is intalled properly in the correct directory) on VScode, displaying images will work, lpaying video will work but the webcam won't work because of permissions assigned to VSCode.

To solve this first enable 'code' in Visual Studio code. You can find how to do this online.

Now go to terminal and type - sudo code (NOW IT WILL WORK {HOORAY!!!})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM