Collada

Gtk

OpenCV [ fr en ]

OpenGL

Ode

Python

Qt

Ftgl


What is OpenCV

OpenCV means Intel® Open Source Computer Vision Library. It is a collection of C functions and few C++ classes that implement some popular algorithms of Image Processing and Computer Vision.

The key features

OpenCV is cross-platform middle-to-high level API that consists of a few hundreds (>300) C functions. It does not rely on external numerical libraries, though it can make use of some of them (see below) at runtime, if they are available.

OpenCV is free for both non-commercial and commercial use (see the license for details).

OpenCV provides transparent for user interface to Intel® Integrated Performance Primitives (IPP) (only ippcv for now). That is, it loads automatically IPP libraries optimized for specific processor at runtime, if they are available. More information about IPP can be retrieved at http://www.intel.com/software/products/ipp/ippvm20/index.htm

There are interfaces to OpenCV for some other languages/environments (more to come):
Firstly the Yahoo group list is very useful for all questions, the last innovation, and all delcared users' contacts.

Return

SourceForge download

Retour

Above all, you have to download this library. SourceForge web site provides the last update (personally, I'm using the beta3.1, it's the last at the present time).
Downloaded once, this library has to be installed.

Return

Windows Installation

Retour

Normally, for the windows installation, there isn't any troubles, so 'ok', 'next', 'next', 'ok', etc...
chargement..
chargement..
chargement..
chargement..
chargement..
chargement..
chargement..
chargement..
chargement..
chargement..
In the 'start' menu, now, we can see :
chargement..
We can also see in the OpenCV installation directory (in my example : c:\Program Files\OpenCV)
chargement..
Now, OpenCV is installed. But you have to compile it before use it. To compile the libraries (cv.lib, cv.dll, highgui.lib, highgui.dll, cvaux.lib, cvaux.dll, etc..), I'm going to use Visual C++. Opening the file OpenCV.dsp (which is in _dsw or start -> Programs -> OpenCV -> OpenCV Workspace), you can find :
chargement..
Those are all the OpenCV project, start compiling :
chargement..
Now, to be able to compile a code source with visual using OpenCV, you have to copy dll files into your work directory (it depends of your needs), as usual : Those files are using for the execution.
  1. To compile your program with Visual C++, you have to add OpenCV headers directories, such as :

    in Tools -> Options
    In 'Include files'
    • c:\PROGRAM FILES\OPENCV\CV\INCLUDE for cv.h
    • c:\PROGRAM FILES\OPENCV\OTHERLIBS\HIGHGUI for highgui.h
    To avoid those errors : fatal error C1083: Cannot open include file: 'cv.h': No such file or directory

    In 'Library files'
    • c:\PROGRAM FILES\OPENCV\LIB for cv.lib, highgui.lib, cvaux.lib, etc..
    To avoid those errors : LINK : fatal error LNK1104: cannot open file "cv.lib"
  2. To link your program with Visual C++,you have to add OpenCV statics libs, such as:

    in Project->Settings, Link
    in 'Object/library modules'
    • cv.lib, highgui.lib (optional cvaux.lib)
    To avoid this kind of errors : File.obj : error LNK2001: unresolved external symbol _cvFlip... _cvRectangle... _cvCircle... _cvFindCornerSubPix... _cvCopy for cv.lib
    or File.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CvvImage::~CvvImage(void)" (??1CvvImage@@UAE@XZ) for highgui.lib

Now you're ready to play with OpenCV

Return

Linux Installation

Retour

Debian Installation

Pakages list :
apt-cache search opencv
libcvaux-dev - development files for libcvaux
libcvaux0.9-5 - computer vision extension library
libcvcam-dev - development files for libcvcam
libcvcam0.9-5 - computer vision camera support library
libhighgui-dev - development files for libhighgui
libhighgui0.9-5 - computer vision GUI library
libopencv-dev - development files for libopencv
libopencv-doc - OpenCV documentation and examples
libopencv0.9-5 - computer vision library
Installation (thx zam):
apt-get install libcvaux-dev libcvaux0.9-5 libcvcam-dev libcvcam0.9-5 libhighgui-dev libhighgui0.9-5 libopencv-dev libopencv-doc libopencv0.9-5

TAR installation

Archive extraction
gunzip opencv-0.9.5.tar.gz
tar -xvf opencv-0.9.5.tar
or
tar -xzvf opencv-0.9.5.tar.gz
Pre-necessary : Library installation :
./configure
make
make install # as root
ldconfig # as root
NB : Personaly, I had troubles with the configure file : the X11 library directory wasn't the good ... so, to check before look for during two weeks...

Return

Installation test

Retour

Compilation test with this small example :
/*
 * foo.c
 */
#include <cv.h>
#include <highgui.h>
int main(int argc,char *argv[])
{
  IplImage *image;
  int x,y;
  image = cvCreateImage(cvSize(300,300),8,1);
  cvSetZero(image);
  for(y=0 ; y < image->height ; y++)
  {
    for(x=0; x < image->width ; x++)
    {
      (image->imageData+image->widthStep*y)[x] = (x*y)%256
    }
  }
  cvNamedWindow("Image",1)
  cvShowImage("Image",image);
  cvWaitKey(0);
  return 0;
}
Compilation line (under debian) :
gcc opencv-config --cflags --libs highgui foo.c -o foo
Resultat of this source code :

Return

Documentation

Retour

Actually, OpenCV help are declared. There are three, actually, more two and half than three :
On line, help aren't a lot.

Return

Windows examples

Retour

Under Windows, it exists few examples :
  • StereoDemo
Stereovision manipulation example
using the camera intrinseqs parameters
  • LKDemo
Corner Tracker example, very powerfully
using optic flow
  • VMDemo
Morphing example
using epipolar lines
  • HMMDemo
Face recognition example
empirical method learning

Return

Linux examples

Retour

The first example that can check the good installation with the following script opencv-config :

Usage: opencv-config [OPTIONS]
Options:
  [--prefix]
  [--cflags]
  [--cxxflags]
  [--libs [opencv] [highgui] [cvcam] [cvaux]]
  [--version]
opencv-config --prefix
/usr
opencv-config --cflags
-I/usr/include/opencv
opencv-config --cxxflags
-I/usr/include/opencv
opencv-config --libs opencv highgui cvcam cvaux
-lopencv -lopencv -lhighgui -lcvcam -lcvaux
opencv-config --version
0.9.5