赞
踩
OpenCV 在 Ubuntu 20.04 软件源中可用。想要安装它,运行:
- sudo apt update
- sudo apt install libopencv-dev python3-opencv
上面的命令将会安装所有必要的软件包,来运行 OpenCV:
通过导入cv2
模块,并且打印 OpenCV 版本来验证安装结果:
python3 -c "import cv2; print(cv2.__version__)"
输出:
4.2.0
1.安装构建工具和所有的依赖软件包:
- sudo apt install build-essential cmake git pkg-config libgtk-3-dev \
- libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
- libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
- gfortran openexr libatlas-base-dev python3-dev python3-numpy \
- libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \
- libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。