VideoCapture.open(0)无法识别pi cam [英] VideoCapture.open(0) won't recognize pi cam

查看:360
本文介绍了VideoCapture.open(0)无法识别pi cam的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Raspberry Pi 2B已有一段时间了.使用raspistill测试Pi凸轮效果很好,但是尝试使用Opencv功能(例如VideoCapture.open();)将无法正常工作.用USB摄像头尝试相同的命令就可以了.我尝试使用不同的索引作为输入,但对pi cam无效.我在这里想念什么?

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 VideoCapture.open(); won't work. trying the same command with a USB camera works just fine. I tried different indexes as inputs but nothing works for the pi cam. What am I missing here?

推荐答案

sudo modprobe bcm2835-v4l2

将自动启用"相机的opencv.

will "enable" the camera for opencv automatically.

确保已从gui或raspi-config的raspberry配置中启用了相机.上面的代码会加载必要的驱动程序以自动处理所有内容,即为树莓派摄像头加载适当的接口(v4l2驱动程序).

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.

在树莓派杰西身上开箱即用.其他版本可能默认包含驱动程序,但是下面的链接包含有关在最坏情况下编译驱动程序的信息.因此您应该也可以将它与pidora一起使用.

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.

更多信息: https://www.raspberrypi.org/forums/viewtopic. php?f = 43& t = 62364

这篇关于VideoCapture.open(0)无法识别pi cam的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆