OpenCV

I came to know about OpenCV at the end of  last year when i was stuck with my main project work.One of my friend told me about it.Thus i started out studying OpenCV.The book “Learning OpenCV” seemed to be a good place to start .I am here publishing the knowledge acquired about OpenCV, during our project work,hoping that someone may find them useful.

Installing OpenCV

Enter into Terminal and

$ sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev cmake libswscale-dev libjasper-dev

To get the OpenCV:

$ wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.1/OpenCV-2.1.0.tar.bz2

Unpack it using

$ tar -xvf OpenCV-2.1.0.tar.bz2

Enter the directory

$cd OpenCV-2.1.0

Then

$cmake
Then to install
$make
$sudo make install

To configure
$sudo gedit /etc/ld.so.conf.d/opencv.conf
Add the following line at the end of the file and then save it:

/usr/local/lib

Run the following code to configure the library:
$sudo ldconfig

open another file:
$sudo gedit /etc/bash.bashrc
Add two lines at the end of the file and save it:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH


Finally, open a new console, restart the computer or logout and then login again.

Then try all sample programs in OpenCV-2.1.0/samples

ABOUT OPENCV

  • Open source computer vision library in C/C++.
  •   Optimized and intended for real-time applications.
  •   OS/hardware/window-manager independent.
  • Generic image/video loading, saving, and acquisition.
  • Both low and high level API.
  • Provides interface to Intel’s Integrated Performance Primitives (IPP) with processor specific optimization (Intel processors).

OpenCV modules:

  • cv – Main OpenCV functions.
  • cvaux – Auxiliary (experimental) OpenCV functions.
  • cxcore – Data structures and linear algebra support.
  •  highgui – GUI functions.

To compile

  • g++ hello-world.c -o hello-world  -I /usr/local/include/opencv -L /usr/local/lib -lm -lcv -lhighgui -lcvaux

To run

  • ./helloworld

One thought on “OpenCV

Leave a comment

Design a site like this with WordPress.com
Get started