Skip to content

Instantly share code, notes, and snippets.

@bikz05
Last active April 22, 2024 20:13
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save bikz05/a8aa07adf89cd5fb89fb to your computer and use it in GitHub Desktop.
Save bikz05/a8aa07adf89cd5fb89fb to your computer and use it in GitHub Desktop.
OpenCV 3 Installation
sudo apt-get update
sudo apt-get upgrade
# Added by me
sudo apt-get install freeglut3 freeglut3-dev libtbb-dev libqt4-dev
# Copied from pyimagesearch.com
sudo apt-get install build-essential cmake git pkg-config
sudo apt-get install libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libatlas-base-dev gfortran
mkdir softwares
cd softwares
git clone https://github.com/itseez/opencv.git
git clone https://github.com/itseez/opencv_contrib.git
cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D BUILD_EXAMPLES=ON -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make -j$(nproc)
sudo make install
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
# Not needed but just do it, you will thank me later on.
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
pip install Cython --install-option="--no-cython-compile"
sudo pip install -U scikit-image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment