Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
#Need libpython, you have to build python with enable-shared
ONFIGURE_OPTS="--enable-shared" pyenv install 3.6.4
pyenv local 3.6.4
wget https://github.com/opencv/opencv/archive/3.4.1.zip
wget https://github.com/opencv/opencv_contrib/archive/3.4.1.zip
unzip 3.4.1.zip
unzip 3.4.1.zip.1
cd opencv-3.4.1/
mkdir build
cd build
export PROOT=~/.pyenv/versions/3.6.4
rm CMakeCache.txt # to delete old config
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.1/modules/ -D BUILD_opencv_python3=ON -D CMAKE_INSTALL_PREFIX=$PROOT -D PYTHON3_LIBRARIES=$PROOT/lib/libpython3.6m.so -D BUILD_opencv_python2=OFF -D BUILD_JAVA=OFF -D WITH_V4L=ON ..
#Check with your eye python3 's all path fond
make -j
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment