Skip to content

Instantly share code, notes, and snippets.

@Samcfuchs
Last active August 15, 2017 15:24
Show Gist options
  • Save Samcfuchs/242d7ef52fcb3836da3f2c7d880d34bb to your computer and use it in GitHub Desktop.
Save Samcfuchs/242d7ef52fcb3836da3f2c7d880d34bb to your computer and use it in GitHub Desktop.
An actual working opencv installer maybe
#!/user/bin/env bash
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y build-essential cmake pkg-config
sudo apt-get install -y libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install -y libxvidcore-dev libx264-dev
sudo apt-get install -y libgtk-3-dev
sudo apt-get install -y libatlas-base-dev gfortran
sudo apt-get install -y python3
sudo apt-get install -y python3-dev
sudo apt-get install -y python
sudo apt-get install -y python-dev
sudo pip3 install numpy
read -p "Press enter to continue"
cd
wget -O opencv.zip https://github.com/opencv/opencv/archive/3.3.0.zip
unzip opencv.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/3.3.0.zip
unzip opencv_contrib.zip
rm opencv.zip
rm opencv_contrib.zip
cd opencv-3.3.0/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules -D PYTHON_EXECUTABLE=/usr/bin/python3 -D BUILD_EXAMPLES=ON ..
make -j4
sudo make install
sudo ldconfig
python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment