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.
wget https://github.com/Itseez/opencv/archive/2.4.5.tar.gz
- 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 ..
make -j4
sudo make install
- Now what we have to do is just config the opencv
sudo ldconfig
After this is your opencv compiled and installed, you are ready to use it with any project. KUDOS
Thanks
For any further queries feel free to contact.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Manu Gupta
Manu is a Native iOS (Swift) and Titanium lead developer . Manu has good experience working with Swift and Alloy framework as well. He loves watching movies and travelling.