sudo apt-get update
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.2.0.zip
unzip opencv.zip
cd opencv-3.2.0
mkdir build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .
make -4j
sudo make install
ok,可以測試一下了
我的測試代碼是:
import cv2
img = cv2.imread("1.jpg")
cv2.imshow('hah',img)
cv2.waitKey(5000)