Last active
September 1, 2017 14:13
-
-
Save andrepearce/4681da89a03b3836a08215e3ea30bc82 to your computer and use it in GitHub Desktop.
Install OpenCV for Python3 on Debian (not tested)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/bash -ex | |
OPENCV=3.3.0 | |
OPENCV_CONTRIB=3.3.0 | |
# Install Pre-requisites | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install build-essential cmake git pkg-config wget \ | |
libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev \ | |
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ | |
libatlas-base-dev gfortran python3.5-dev unzip | |
# Install Pip3 | |
wget https://bootstrap.pypa.io/get-pip.py | |
sudo python3 get-pip.py | |
# Install NumPy | |
pip3 install numpy | |
# Install OpenCV | |
cd ~ | |
wget https://github.com/opencv/opencv/archive/${OPENCV}.zip | |
unzip opencv-${OPENCV}.zip | |
wget https://github.com/opencv/opencv_contrib/archive/${OPENCV_CONTRIB}.zip | |
unzip opencv_contrib-${OPENCV_CONTRIB}.zip | |
cd ~/opencv-${OPENCV} | |
mkdir build | |
cd build | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D INSTALL_C_EXAMPLES=OFF \ | |
-D INSTALL_PYTHON_EXAMPLES=ON \ | |
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-${OPENCV_CONTRIB}/modules \ | |
-D BUILD_EXAMPLES=ON | |
make | |
sudo make install | |
sudo ldconfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment