Installing OpenCV on ubuntu

Lets get it started,..

Step 1.  Please install file dependencies required from OpenCV, just run the following commands  see below :

sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev 
pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev 
libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev
libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev
libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev
libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip

Step2. Download Open Cv 3.0 from official opencv, for ubuntu just copy and paste command below :

mkdir opencv    //this command for create directory
cd opencv       // go to directory opencv after create
wget https://github.com/Itseez/opencv/archive/3.0.0-alpha.zip -O opencv-3.0.0-alpha.zip   // this command for download repo using wget
unzip opencv-3.0.0-alpha.zip    /// exstrack file if you don't have unzip just type apt-get install zip

step3. : Install OpenCV

cd opencv-3.0.0-alpha
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make -j $(nproc)
sudo make install

step4. :Finishing installation

How to get OpenCV working properly on your computer, we need to tell Ubuntu:

sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig

step5. :Testing

For testing opencv running as well on your machine type python  an then type import cv2

see Fig. Below :

source : http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/

Regards,

SRW

Be the first to comment

Leave a Reply

Your email address will not be published.


*