Install dependency sudoapt-get-yinstalllibopencv-devsudoapt-get-yinstallbuild-essentialcheckinstallcmakepkg-configyasmsudoapt-get-yinstalllibtiff4-devlibjpeg-devlibjasper-devsudoapt-get-yinstalllibavcodec-devlibavformat-de first
First install dependency sudo apt-get-y install libopencv-devsudo apt-get-y install build-essential checkinstall cmake pkg-config yasmsudo apt-get-y install libtiff4-dev libjpeg-libdev libjasper- devsudo apt-get-y install libavcodec-dev libavformat-de
First install the dependency
sudo apt-get -y install libopencv-devsudo apt-get -y install build-essential checkinstall cmake pkg-config yasmsudo apt-get -y install libtiff4-dev libjpeg-dev libjasper-devsudo apt-get -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-devsudo apt-get -y install python-dev python-numpysudo apt-get -y install libtbb-devsudo apt-get -y install libqt4-dev libgtk2.0-devsudo apt-get -y install libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-devsudo apt-get -y install x264 v4l-utils ffmpegsudo apt-get -y install libgtk2.0-dev
Sudo apt-get update
Go to the official website to download OpenCv 2.4.9 or OpenCv3.0.0
Decompress the package
# Important
Disable CUDA support (OFF) in CMakelist.txt)
Mkdir build
Cd build
Sudo cmake-D CMAKE_BUILD_TYPE = RELEASE-D CMAKE_INSTALL_PREFIX =/usr/local ..
Make-j 4
Sudo make install
Sudo sh-c 'echo "/usr/local/lib">/etc/ld. so. conf. d/opencv. conf'
Sudo ldconfig