尽量使用最新的树莓派Raspbian镜像,执行下面的命令更新系统库:

sudo apt update
sudo apt install -y libatlas-base-dev libjasper-dev libqtgui4 python3-pyqt5 libqt4-test libhdf5-dev

pip3安装opencv4,只是特定几个版本的opencv可以安装

sudo pip3 install opencv-contrib-python==4.1.0.25
# 或者
sudo pip3 install opencv-contrib-python==4.4.0.46

测试

python3 -c "import cv2;print(cv2.__version__)"

RobinTang
3.9k 声望37 粉丝