Skip to content
Anton Mitrokhin edited this page Apr 24, 2017 · 2 revisions

To install a new version of OpenCV on you system please follow these instructions:

  1. Download .zip archives with source code of OpenCV (link) - you may choose the 'tag' with an appropriate version and then click 'Clone or Download' -> 'Download ZIP'
  2. Do the same with opencv_contrib (link) - make sure the tag (the version) of OpenCV and opencv_contrib is the same.
  3. Create a directory ~/opencv
  4. Unzip both archives inside ~/opencv
  5. Execute (note the last portion of cmake command with a path to the opencv_contrib):
sudo apt-get -y 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

cd opencv-3.0.0-rc1
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.0.0-rc1/modules ..
make -j $(nproc)
sudo make install

  1. Finalize installation with:
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig