Getting Started (LINUX)

Now let’s set up OpenCV on our Ubuntu Machine.

You need following components to compile and install OpenCV libraries on your ubuntu system.

  • GCC 4.3 or later. In Ubuntu/Debian it can be installed with

 sudo apt-get install build-essential

  • CMake 2.6 or higher

sudo apt-get install cmake cmake-qt-gui

  • Subversion (SVN) client / Git

sudo apt-get install git

  • GTK+ 2.x or higher, including ers (e.g. libgtk2.0-dev)

sudo apt-get install libgtk2.0-0 libgtk2.0-dev

  • pkgconfig

sudo apt-get install pkg-config

  • libpng, zlib, libjpeg, libtiff, libjasper with development files (e.g. libjpeg-dev)

sudo apt-get install libpng12-0 libpng12-dev zlib1g zlib1g-dev libjpeg8 libjpeg8-dev libjpeg62 libjpeg62-dev libtiff4 libtiff4-dev libtiff5 libtiff5-dev libjasper1 libjasper-dev

  • Python 2.3 or later with developer packages (e.g. python-dev)

sudo apt-get install python2.7 python2.7-dev

  • SWIG 1.3.30

sudo apt-get install swig swig2.0

sudo apt-get install ffmpeg

  • libdc1394 2.x + headers for video capturing from IEEE1394 cameras

sudo apt-get install libdc1394-22 libdc1394-22-dev

Download OpenCV latest Stable version from their sourceforge repo

select the one you want 2.4.4 is the latest and stable one


extract the files from the archive anywhere you want, now cd into OpenCV-2.4.4 , do a mkdir release

now cd into release and type cmake-gui ../

a GUI will be presented click on configure , read and check the boxes you want , now click generate , ok so now we have geenrated some UNIX makefiles

cd into your OpenCV-2.4.4/release and then type sudo make install

now do a ldconfig -v

and then export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH  default installation directory is /usr/local/lib

FInally OpenCV is ready to be used 😀

Next tutorial will be about setting up Eclipse CDT IDE to make our life easy.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s