[关闭]
@SiberiaBear 2014-12-16T13:19:09.000000Z 字数 2045 阅读 4958

树莓派摄像头问题汇总

raspberryPi

固定地址:


1. AttribureError 属性错误(单独列出)

安装完UV4L驱动之后尝试拍照找不到摄像头,或者杀掉UV4L进程后如何重新启动UV4L的命令

解决办法:重启驱动程序

错误提示:

  1. libv4l2: error setting pixformat: Device or resource busy
  2. HIGHGUI ERROR: libv4l unalbe to ioctl S_FMT
  3. WARNING:SimpleCV can't seem to find a camera on your system, or the drivers do not work with SimpleCV.
  4. ERROR:
  5. Traceback (most recent call last):
  6. File "camera.py", line6, in <module>
  7. img = cam.getImage()
  8. File "/usr/local/lib/python2.7/dist-packages/SimpleCV/Camera.py", line 579, in getImage
  9. if (not self.threaded):
  10. AttributeError: Camera instance has no attribure 'threaded'

解决办法:3句话

  1. pi@raspberrypi ~ $ pkill uv4l
  2. pi@raspberrypi ~ $ uv4l --driver raspicam --auto-video_nr --encoding yuv420 --nopreview
  3. pi@raspberrypi ~ $ export LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so

最后可以ls /dev一下,检查一下有没有video0

参考:http://www.raspberrypi.org/forums/viewtopic.php?t=57788

2. IndentationError

缩进符混输错误

解决办法:重新编排缩进

错误提示:

  1. File "motion.py", line 15
  2. current.save(display)
  3. IndentationError: unindent does not match any outer indentation level

解决办法:
重新编排缩进,很有可能是TAB键和4个空格键混合使用的错误

3. AttributeError 属性错误

类型无对应属性

错误提示:
(例)

  1. AttributeError: Display instance has no attribute 'isDown'

解决办法:
错误的把Display.isDone写成Display.isDown

类型未捕获,故而不会找到属性

错误提示:
(例)

  1. AttributeError: 'NoneType' object has no attribute 'draw'

意为,没有找到类型,从而不会有draw属性
解决办法:
从前边的处理过程看问题,可能是没有捕获到物体

4. Fatal Python error

Segmentation Fault 未解决

错误提示:

  1. Fatal Python error: (pygame parachute) Segmentation Fault

未解决

ceval: tstate mix-up 未解决

错误提示:

  1. Fatal Python error: ceval: tstate mix-up
  2. Aborted

未解决

5. TypeError 格式错误

参数位长度错误

错误提示:

  1. must be sequence of length 2, not 1

如题:必须是一个2位长度的序列,而不是1位的
比如我犯这样的错误是因为将2位的坐标只写了1位
或者:featureset.coordinates()不等价于(featureset.x, featureset.y)

函数参量中数据格式错误

错误提示:

  1. an integer is required

错误提示中给出的错误段中有一个量是integer类型的,现在你指定的不是这个类型的,所以报错

a float is required 未解决

6. ValueError 值错误

unsupported bit depth for aaline draw (supports 32 & 24 bit) 未解决

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注