Skip to main content

Installing OpenCV-2.4.11 from core in Ubuntu 14.04

Note: This tutorial has been tested on Ubuntu 14.04 LTS with OpenCV 2.4.11 which is most stable opencv version till date. If you find some configuration settings erroneous please do mention the platform details in the comment and the error Thanks!
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.
2. INSTALL THE DEPENDENCIES
Build tools:
sudo apt-get install build-essential cmake
GUI:
sudo apt-get install qt5-default libvtk6-dev
Media I/O:
sudo apt-get install zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libjasper-dev libopenexr-dev libgdal-dev
Video I/O:
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
Parallelism and linear algebra libraries:
sudo apt-get install libtbb-dev libeigen3-dev
Python:
sudo apt-get install python-dev python-tk python-numpy python3-dev python3-tk python3-numpy
sudo apt-get install build-essential checkinstall cmake pkg-config yasm

sudo apt-get install libtiff4-dev libjpeg-dev libjasper-dev

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev
libgstreamer-plugins-base0.10-dev libv4l-dev. 

Now Download OpenCV from opencv.org or from this OpenCV-2.4.11
4. COMPILE AND INSTALL OPENCV 
In your terminal, make sure you are within the OpenCV directory and run the following commands:
mkdir build
cd build
cmake -D WITH_XINE=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_V4L=ON..
make -j4
sudo make install
5. CONFIGURE OPENCV 

1. Open a text editor and edit the ld.so.conf file by changing directory into it with privileges

sudo nano /etc/ld.so.conf

 2. Enter the following line into it


/usr/local/lib

3. Close and save and exit and enter the following command


sudo ldconfig

sudo nano /etc/bash.bashrc

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lo­cal/lib/pkgconfig

export PKG_CONFIG_PATH


4. Now you are ready for testing

cd ~/OpenCV-2.4.6/samples/c
chmod +x build_all.sh
./build_all.sh

5. Try the python examples and make sure they work

python ~/OpenCV-2.4.10/samples/python2/turing.p­y

Comments

Post a Comment

Popular posts from this blog

How To configure and install RHadoop ( R Streaming in Hadoop)

For installing and configuring RHadoop framework we would require Hadoop (2.6.0 and above installed on every machine if in cluster) and RStudio. You can refer Michael G Noll's Blog or Chalpritam's Blog for both hadoop single and multi-node setup. This configuration and installation steps have been tested on Ubuntu 14.04 LTS 32-bit OS please feel free to contact me via comments if there is some error in steps 1. Getting into root access to install all the RHadoop libraries globally      sudo su 2. Start R Terminal using the command below    R 3. Install RHadoop framework Libraries by using the following commands install.packages(c("codetools", "R", "Rcpp", "RJSONIO", "bitops", "digest", "functional", "stringr", "plyr", "reshape2", "rJava"))  install.packages(c("dplyr","R.methodsS3"))  install.packages(c("Hmisc"))   instal

Installing Anaconda and Spyder

Anaconda and Spyder are world class scientific as well as financial analysis IDE for python. Anaconda and Spyder Installation saves you from installing and configuring numpy and scipy components separately.If any of the commands doesn't work please notify me in the comments. Thanks!!! Install Anaconda from here  Anaconda sudo -su bash Anaconda-2.2.0-Linux-x86.sh apt-get install spyder spyder