and Python interface

Ubuntu 16.04 LTS OpenCV C / C++ and Python interface (接口)

  1. Install OpenCV from the Ubuntu Repository (apt) - Python 调用接口
    Python3

sudo apt update
sudo apt install python3-opencv
1
2
Python2

sudo apt update
sudo apt install python-opencv
1
2
OpenCV version

python3 -c “import cv2; print(cv2.version)”
python2 -c “import cv2; print(cv2.version)”
1
2
Uninstall OpenCV

sudo apt remove python3-opencv -y
sudo apt remove python-opencv -y
1
2
2. Install OpenCV from the Ubuntu Repository (pip) - Python 调用接口
Python3

sudo apt update
sudo pip3 install opencv-python
sudo pip3 install opencv-contrib-python

sudo pip3 install opencv-python4.2.0.32
sudo pip3 install opencv-contrib-python
4.2.0.32

sudo pip3 install -i https://pypi.douban.com/simple opencv-python3.4.1.15
sudo pip3 install -i https://pypi.douban.com/simple opencv-contrib-python
3.4.1.15
1
2
3
4
5
6
7
8
9
Python2

sudo apt update
sudo pip2 install opencv-python
sudo pip2 install opencv-contrib-python

sudo pip2 install opencv-python4.2.0.32
sudo pip2 install opencv-contrib-python
4.2.0.32

sudo pip2 install -i https://pypi.douban.com/simple opencv-python3.4.1.15
sudo pip2 install -i https://pypi.douban.com/simple opencv-contrib-python
3.4.1.15
1
2
3
4
5
6
7
8
9
OpenCV version

python3 -c “import cv2; print(cv2.version)”
python2 -c “import cv2; print(cv2.version)”
1
2
Uninstall OpenCV

sudo pip3 uninstall opencv-python
sudo pip3 uninstall opencv-contrib-python

sudo pip2 uninstall opencv-python
sudo pip2 uninstall opencv-contrib-python
1
2
3
4
5
3. Install OpenCV from the Ubuntu Repository (pip) - C / C++ 调用接口 (OpenCV 2.4.9.1)
Install OpenCV

sudo apt-get update
sudo apt-get install libopencv-dev -y
1
2
Uninstall OpenCV

sudo apt-get autoremove libopencv-dev
1
OpenCV version

pkg-config --modversion opencv
1
4. Install OpenCV 4 from the official site - C / C++ 调用接口 (OpenCV 4.2.0)
Install OpenCV
https://blog.csdn.net/chengyq116/article/details/104297224

bash install-opencv.sh
1
OpenCV version

pkg-config --modversion opencv4
1
Uninstall OpenCV
进入 …/OpenCV/build/ 目录,执行 sudo make uninstall。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值