代码之家  ›  专栏  ›  技术社区  ›  Dan Sweeney

opencv-无法从raspberry pi上的摄像头捕获帧

  •  1
  • Dan Sweeney  · 技术社区  · 7 年前

    我的pi摄像头已连接并启用,raspistill成功拍照。在python中,cv2。视频捕获(-1)。read()始终返回(False,None)。我被难住了。

    1 回复  |  直到 4 年前
        1
  •  2
  •   Mark Setchell    7 年前

    OpenCV 依赖于V4L2(Linux视频)模块,因此请尝试在文件底部添加以下行 /etc/modules 重新启动你的覆盆子Pi。

    bcm2835-v4l2
    

    我的现在看起来像这样 总计 :

    # /etc/modules: kernel modules to load at boot time.
    #
    # This file contains the names of kernel modules that should be loaded
    # at boot time, one per line. Lines beginning with "#" are ignored.
    
    bcm2835-v4l2
    

    Broadcom视频Linux 2版 (v4l2)驱动程序在所有后续重新引导时加载。