树莓派操作二之OpenCV
一、安装OpenCV2
1、libopencv-dev
libopencv是一个集合包,它简单地引用一个或多个相关的包。专门用于在Ubuntu和Debian操作系统中安装OpenCV
sudo apt-get install libopencv-dev
2、python-opencv
python -OpenCV是OpenCV库,作为python绑定的包装器使用。
sudo apt-get install python-opencv
3、测试opencv2
pi@raspberrypi:~ $ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__ #注意version前后分别是两条下划线
'3.2.0'
4、设置CSI摄像头
终端输入vcgencmd get_camera,得到supported = 1 detected = 1,若supported=0,则没成功使能摄像头服务或使能后没有重启树莓派,若detected = 0,则可能是摄像头的排线松了或插反了。
本文来自博客园,作者:登云上人间,转载请注明原文链接:https://www.cnblogs.com/lj15941314/p/15023312.html