cv2.VideoCapture.open() always returns FALSE

后端 未结 8 2157
没有蜡笔的小新
没有蜡笔的小新 2020-12-09 17:52

I am trying to access a Logitech c310 webcam on my beaglebone. It always returns false for any device ID, I am not sure why.

I use the following code.



        
8条回答
  •  猫巷女王i
    2020-12-09 18:32

    I met the similar issue. It may be related to user permission. Try using the follow procedure to diagnose the issue.

    1. Run the following command to determine the camera access permission

      ls -la /dev/video*

      You might get similar output as below (you might get video1 if you have multiple cameras). As you can see, only root user and users in video group have the permission to access the camera.

      crw-rw----. 1 root video 188, 0 Apr 3 21:16 /dev/video0

    2. So the fix is simple, add your user account to the video group, using the follow command:

      sudo usermod -a -G video

    Hope it helps!

提交回复
热议问题