1 installing cmake and some dependent libraries
sudo apt-get install CMake
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev Libtiff4.dev Libswscale-dev Libjasper-dev
CentOS or Redhat:
Yum install cmake gcc gcc-c++ gtk+-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-d Evel Libpng-devel gstreamer-devellibavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils Swig Python libtool nasm
2 Installing OPENCV
Download OpenCV and unzip from official website, cd command to enter OPENCV directory
: http://opencv.org/downloads.html
CMake.
(CMake time is longer, about half an hour)
sudo make
sudo makeinstall
3 Configuration
Add the OpenCV library to the path so that the system can be found, not the first one plus the second
sudo gedit/etc/ld.so.conf.d/opencv.conf
sudo gedit/etc/ld.so.conf
Add/usr/local/lib at the end to save the exit
sudo ldconfig #使配置生效
sudo gedit/etc/bash.bashrc
Join at the end
Pkg_config_path= $PKG _config_path:/usr/local/lib/pkgconfig
Export Pkg_config_path
Save exit
sudo source/etc/bash.bashrc #使配置生效
Installation configuration for Linux under OpenCV