Skip to content

Instantly share code, notes, and snippets.

@RobinCPC
Last active February 25, 2016 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobinCPC/3885e04845fe282d6562 to your computer and use it in GitHub Desktop.
Save RobinCPC/3885e04845fe282d6562 to your computer and use it in GitHub Desktop.
This file contain steps of install OpenCV 3.10 (personal VM ros hydro 12)

OpenCV install command list:

Intall OpenCV 3.1 in Ubuntu 12.04 LTS

  1. KEEP UBUNTU OR DEBIAN UP TO DATE

Open your terminal and execute:

$ sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
  1. INSTALL THE DEPENDENCIES
$ sudo apt-get install build-essential
$ sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
$ sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

optional:

$ sudo apt-get install qt5-default libvtk6-dev  #(not work:)
E: Unable to locate package qt5-default
E: Unable to locate package libvtk6-dev
$ sudo apt-get install libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-dev

$ sudo apt-get install libtbb-dev libeigen3-dev

$ sudo apt-get install doxygen
  1. DOWNLOAD AND DECOMPRESS OPENCV Getting the Cutting-edge OpenCV from the Git Repository
// bash
cd $HOME/packages
mkdir OpenCV-3.1.0-dev (may not need)
cd OpenCV-3.1.0-dev   (may not need)
$ git clone https://github.com/Itseez/opencv.git opencv-3.1.0-dev
  1. Compile OpenCV
$ cd opencv-3.1.0-dev
$ mkdir build
$ cd build

$ cmake -D CMAKE_BUILD_TYPE=Release -D WITH_TBB=ON -DFORCE_VTK=ON -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_OPENGL=ON -DWITH_GDAL=ON -DWITH_XINE=ON-D OPENCV_EXTRA_MODULES_PATH=~/packages/opencv_contrib/modules -D CMAKE_INSTALL_PREFIX=/usr/local ..

$ make -j7 # runs 7 jobs in parallel
$ make install
  1. configure OpenCV
$ sudo vim /etc/ld.so.conf.d/opencv.conf

add following line to file

/usr/local/lib

execute configure file

$ sudo ldconfig

Reference:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment