OpenCV Installation in Ubuntu

Posted By Karan Bhardwaj | 06-May-2015

INTRODUCTION :  OpenCV is a open source framework mainly aimed at real time computer vision. It is a cross platform framework which is mainly used for real time image processing.

 

Applications based on OpenCV Framework are as follow.

 

1) Facial recognition system
2) Gesture recognition
3) Human–computer interaction (HCI)
4) Mobile robotics
5) Motion understanding
6) Object identification
7) Segmentation and recognition
8) Stereopsis stereo vision: depth perception from 2 cameras
9) Structure from motion (SFM)
10) Motion tracking

 

OpenCV Installation.

Step 1. First of all you need install all the dependencies in your system that are required by the opencv framework.To install dependencies in your system you need run this command.

 

 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
 

 

Step 2. Now make the directory where you want to install OpenCV in your system by the following commands as below. you can download manually or run the following commands.

 

mkdir opencv
cd opencv
wget https://github.com/Itseez/opencv/archive/3.0.0-alpha.zip -O opencv-3.0.0-rc1.zip
unzip opencv-3.0.0-rc1
 

 

Step 3. Now, let's start installing OpenCV. Cmake command has a lot of options: choose those that better suit your needs and run the commands below as mentioned. If you’re planning to use Qt 5.x, don’t use -D WITH_QT=ON.

 

 cd opencv-3.0.0-rc1
mkdir build
cd build
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 WITH_QT=ON -D WITH_OPENGL=ON ..
make -j $(nproc)
sudo make install
 

 

Step 4. Now atlast finalzing the installation. To get OpenCV working properly, we need to tell Ubuntu.

 

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

 

 Now installation is almost done you need to reboot your system. to check open cv version you need to run the below command.

 pkg-config --modversion opencv

Thanks

Request for Proposal

Recaptcha is required.

Sending message..