This post is intended to aid linux enthusiasts to install the latest OpenCV version 3.0.0 on their computer. The method is tested in Ubuntu 12.04 desktop and can also be applied to Mint and Debian users. Eventhough the method mentioned below will overwrite any existing OpenCV installation on your system, it is advised to remove any previous installation.
Open a terminal and type the following to update the source list. And install some packages required.
sudo apt-get update
sudo apt-get upgrade
apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev default-jdk ant libvtk5-qt4-dev
For downloading the source use the following command
cd ~ Download the file Opencv Version 3.0-Alpha for Linux/Mac from www.opencv.org. Decompress the file obtained above using the below command.
Now all we need is to build the OpenCV for your system. For this use the following commands
mkdir build && cd build
Configure with additional options
cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_IPP=OFF -D CMAKE_INSTALL_PREFIX=/usr ..
Note: Above command should not return any error. If returned with error try disabling some options eg: BUILD_EXAMPLES=OFF
If user need to work with Microsoft Kinect sensor then OpenNI should be installed(please follow our previous post for this) and should configure cmake with the following command
should configure openni by changing WITH_OPENNI=ON and configure with the correct path to openni. Usually it should be /usr/include/ni
Then configure and generate the cmake file.
Finally install the build files to your system.
sudo make install
For testing the installation try to compile and run a program as in our previous post.