【发布时间】:2020-08-21 23:17:31
【问题描述】:
我的 pi 相机已连接并启用,raspistill 成功拍照。在 python 中,cv2.VideoCapture(-1).read() 总是返回 (False, None)。我被难住了。
【问题讨论】:
-
成功了,非常感谢
标签: opencv raspberry-pi
我的 pi 相机已连接并启用,raspistill 成功拍照。在 python 中,cv2.VideoCapture(-1).read() 总是返回 (False, None)。我被难住了。
【问题讨论】:
标签: opencv raspberry-pi
OpenCV 依赖于 V4L2(Linux 视频)模块,因此请尝试在文件 /etc/modules 的底部添加以下行并重新启动您的 Raspberry Pi。
bcm2835-v4l2
我的现在看起来像这样toto:
# /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 Video For Linux 2 (v4l2) 驱动程序。
【讨论】: