已连接摄像头的树莓派zero w调用外接的sci摄像头失败

已连接摄像头的树莓派zero w调用外接的sci摄像头失败

问题描述:

问题遇到的现象和发生背景

我用树莓派zero w开发机器鱼,机器鱼有自带的摄像头,可正常调用。若调用外部sci摄像头,需添加节点video0,将代码cam1 = Camera(1,prop_set={'width': pic_width, 'height': pic_height})修改为cam1 = Camera(0,prop_set={'width': pic_width, 'height': pic_height}),但运行失败,报错如下:

pi@raspberrypi:$ sudo python main9.py
liby412: error setting pixformat: Device or resource busy
HIGHGUI ERROR:libv41 unable to ioctl S_FMT
11bV412: error setting pixformat:Device or resource busy
11bV411: error setting pixformat:Device or resource busy
11bV412: error setting pixformat:Device or resource busy
11bV411: error setting pixformat:Device or resource busy
HIGHGUI ERROR:libv41 unable to ioctl VIDIOCSPICT

WARNING: caught exception: SystemError(’ioct1(VIDIOC S FMT)failure: no supported formats',)
WARNING: SimpleCV can't seem to find a camera on your system,or the drivers do not work with SimpleCV. 
ERROR:
Traceback (most recent call last):
File "main9.py",line 328,in<module>
img1=snapshot(caml,x)
File "main9.py"line 18, in snapshot
img=cam. getlmage()
File "usr/local/lib/python2.7/dist-packages/SimpleCV-1.3-py2.7.egg/SimpleCV/Camera. py
line 618,in getImage
cv.GrabFrame(Self.capture)
TypeError: Expected CvCapture for argument 'capture'


我的解答思路和尝试过的方法

我是按照教程一步步配置的,类似

  $ sudo apt-get update
   $ sudo apt-get upgrade 

$ sudo raspi-config

都已完成
一些尝试:

pi@raspberrypi:~ $ vcgencmd get_camera
supported = 1 detected = 1
pi@raspberrypi:~ $ raspistill -o image.jpg
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates
我想要达到的结果

含有cam1 = Camera(0,prop_set={'width': pic_width, 'height': pic_height})的代码能在机器鱼中正常运行

你的摄像头参数可否告知一下