VideoCapture.open(0) won't recognize pi cam

后端 未结 2 1751
滥情空心
滥情空心 2020-12-09 03:57

I have been working with my Raspberry Pi 2B for a while now. Testing the Pi cam using raspistill works great but trying to use OpenCV functions such as Vi

相关标签:
2条回答
  • 2020-12-09 04:17
    sudo modprobe bcm2835-v4l2
    

    will "enable" the camera for opencv automatically.

    make sure you have the camera enabled from the raspberry config, either gui or raspi-config. the above loads the necessary drivers to handle everything automatically, i.e. loads the appropriate interfaces (v4l2 drivers) for the raspberry camera.

    works out of the box on raspbian jessie. other releases might include the drivers by default, but the link below contains info on compiling the drivers in your worst case. so you should be able to get this to work with pidora as well.

    more info: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=62364

    0 讨论(0)
  • 2020-12-09 04:17

    I assume your question is about the C++ API, not the python one? As far as I understand the raspberry pi camera is not a usb camera and as such should be approached differently. For python there is is picamera package which works like a charm (with opencv). I never used the C++ interface but a quick google leads to this

    0 讨论(0)
提交回复
热议问题