关于树莓派zero外接USB摄像头在python上的调试——报错汇总
-
- 1.调试代码
- 2.各种报错
-
-
- 1.ImportError: No module named cv2.cv
- 2.ImportError: libjasper.so.1: cannot open shared object file: No such file or directory
- 3.ImportError: libQtTest.so.4: cannot open shared object file: No such file or directory
- 4.cv2.error: OpenCV(3.4.3) /home/pi/packaging/OpenCV-python/opencv/modules/imgproc/src/resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
-
- 3.完成
- 3.1其实。。还没完
今天上午忽然想把一个USB摄像头接到树莓派上。。。
关于出现的一系列问题,怕自己忘记怎么解决——果然还是放博客上安全。然后就有了以下的内容:为了实现标题里面的内容,我们需要:
- 淘宝上买的网络摄像头
- 树莓派zero
- 笔记本一台
- USB数据线
- 网络
设备并没有硬性规定,以上仅供参考,用触摸屏+无线网卡也是不错的选择
(我在想会不会因为文章内容太水被删。。。)
首先
强烈推荐一个网站 https://github.com/ 很多资源都可以在上面找到。
然后开始我的自黑文。。
1.调试代码
Close the door and release the code!
import cv2 as cv
# 惯例的导入程序
video_capture = cv.VideoCapture(0)
while 1:
# Grab a single frame of video 从录像中取出一帧
ret, frame = video_capture.read()
# Display the resulting image 显示图像
cv.imshow('Video', frame)
# Hit 'q' on the keyboard to quit! 按‘q’来退出
if cv.waitKey(1