OpenCVimutilsNoneTypeError

Traceback (most recent call last):
File "camlock/camlock2.py", line 76, in <module>
frame = imutils.resize(frame, width=640, height= 480)
File "/usr/local/lib/python2.7/dist-packages/imutils/convenience.py", line 69, in resize
(h, w) = image.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'

早上突然出现了这个错误。网上搜了很多都说是视频的源路径出错导致传给了imutils空的路径。可是测试树莓派摄像头时却一切正常。
突然想起昨晚装的 v4l-2 驱动好像没加载。测试之后果然修复了NoneTypeError.

sudo modprobe bcm2835-v4l2

It could be the path problem, but in my case it is the v4l2 thing that makes the trouble.

加载评论框需要翻墙