How to access webcam through opencv in bash?

2019-07-29 05:42发布

问题:

When accessing webcam through python opencv, isOpened() returns False and no data is read. Does it has to do something with wsl?

回答1:

According to this github issue, hardware access is not supported yet in WSL:

Ben Hillis: Hardware access is another area we will be investigating in the future.

All hardware related CLI tools seem to fail (dmesg, lsblk, lsusb returns nothing, /dev is empty...) so it looks like this statement is still valid today. That explains why you cannot access your camera in OpenCV.