ubuntu 安装 opencv python2可用

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)

你可能感兴趣的:(ubuntu 安装 opencv python2可用)