Reprint to: http://blog.csdn.net/hansry/article/details/75309906
Due to the installation of Ros, the Ros-indigo-destop-full version was installed with the version 2.4.8 OpenCV. Due to the need to use 3 in the program. X version of the OpenCV, so on the original opencv2.4.8 installed OPENCV3, you need to set the OPENCV3 installation path, etc., to achieve multi-version OpenCV coexistence.
View current OPENCV version:
Pkg-config--modversion OpenCV
Installing the OPENCV3 series:
(1) After downloading the installation package on the official website, unzip, first install the OpenCV dependencies,
sudo apt-GetInstall Build-essential libgtk2.0-dev libvtk5-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev Libtbb-dev
(2) Enter the OPENCV installation package, create a new build directory, and enter the directory
mkdir build && cd build
(3) Compiling and installing
cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_TBB=ON -D WITH_V4L=ON -D CMAKE_INSTALL_PREFIX=/usr/local/opencv320 ..
make
sudo make install
修改bashrc文件:
sudo gedit ~/. BASHRC Add the following two statements to the end of the file: Export pkg_config_path=/usr/local/opencv320/lib/pkgconfig export ld_ Library_path=/usr/local/opencv320/
How to use it in the CMake tool:
Use Opencv2. 4 3 REQUIRED)
Reprint: Ubuntu14.04 and opencv2.4.8, opencv3.0 version Coexistence