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

Customizing(Hacking) softwares in Windows

Often a times, we feel not satisfied with the functioning of an already installed software and we wish whether we could change it. To tell you, the look, dialogs, windows are all hard coded to form a software and at the first place it seems an impossible task for us to customize it especially when we only have an .exe file of it. But wait! That same exe file is all you need! I will share with you two amazing tools which I use and by experience I am telling you, they are damn easy. Resource Tuner and Resource Hacker. Let' see what they have got for us. They are tools which enables you to customize your programs by modifying the executable files( EXE, DLL, SYS, MSSTYLES, SCR and more) without any programming skills required! You can change the icon, replace the images in the applications, translate the messages, change the menu or any other element of your user interface with just a matter of few clicks. To upload an exe file you can just do it from the "open" option u...

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...