How to setup OpenCV in Ubuntu
Posted By Manu Gupta | 04-May-2016
In this blog i will guide you through the process of setting openCV on your linux machine.Open cv is open source computer vision library of programming functions which is very helpful in case you want to play with your images .
First of all what we have to do is get the things upto date
- Open your terminal and write this command to update
sudo apt-get uodate && sudo apt-get upgrade
- After that install the dependencies which will later help us in compiling the openCV library
sudo 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 libeigen2-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
- Now download the current stable version of openCV. For my project i was required of openCV-2.4.5. You can directly download the below mentioned command and remmember the path where you have downloded it.
- Untar the tar file
tar -xvf 2.4.5.tar.gz
- Now after this we have to make a cmake file for that what we have to do is open the opensc-2.4.5 folder and create a new folder called build.
mkdir build cd build
- Now all the steps are required to compile the openCV
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -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_QT=ON -D WITH_OPENGL=ON ..
sudo make install
- Now what we have to do is just config the opencv
After this is your opencv compiled and installed, you are ready to use it with any project. KUDOS
For any further queries feel free to contact.