Disclaimer This guide has an intent to install the OpenCV libraries for development. Please notice that i'm no Linux expert and this can eventually break your system. Do at your own rist.
-
Many packages are required in order to compile the OpenCV libraries.
-
If you have a system with
apt-get
:
apt-get install gcc-6 libgcc-6-dev
apt-get install ant build-essential python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
apt-get install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip
- After the required packages are installed, make sure that
gcc
is calling the correct version:
alias gcc=/usr/bin/gcc-6
- Download the
openvc
andopenvc_contrib
sources from GitHub:
git clone https://github.com/Itseez/opencv.git
cd opencv
git clone https://github.com/Itseez/opencv_contrib.git
- Configure and compile the source: (This will take some time. Relax and grab a
beercoffee!)
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../opencv
make -j $(nproc)
make install