JetPack 4.3自带了opencv 4.1.1,而当使用python3导入cv2时,发现仍缺少依赖,首先使用清华镜像源因此使用以下代码进行安装:
sudo apt-get update
sudo apt-get install -y build-essential make cmake cmake-curses-gui
sudo apt-get install -y git g++ pkg-config curl libfreetype6-dev
sudo apt-get install -y libcanberra-gtk-module libcanberra-gtk3-module
sudo apt-get install -y python3-dev python3-testresources python3-pip
sudo pip3 install -U pip
sudo pip3 install protobuf==3.3.0
sudo pip3 install numpy matplotlib
如果pip3按照包时失败,可改用
sudo apt-get install python3-xxx
然后
import cv2
cv2.__version__
#4.1.1