UPDATE: I’ve update this entry for the latest OpenCV (2.3.1). For more information I recommend to look for the related information from this site:
And the installation details are on this site:
I believe this website should contains all the related references and tutorials for your OpenCV project. Best Wish.
After a long way try to develop C program with OpenCV library on Ubuntu Linux using NetBeans and Eclispe IDE, no succeed at all. There are always some problems occurs and the project cannot move on further so everything has to be move back onto Windows to be developed. But now all these thing can be developed in Linux by using traditional GNU C Compiler (GCC) that most of Linux users know it very well. This is the complete procedure from the beginning(install) till the end(compile-build).
Part A. Install OpenCV 2.3.1
1. Install prerequisites
Enter this line into Linux Terminal:
$sudo apt-get install build-essential cmake ;
ffmpeg libjpeg-dev libpng-dev libtiff-dev
All these packages are the prerequisites for compiling and running OpenCV.
2.Get OpenCV 2.3.1 sourcecode
3. Extract and Compile OpenCV 2.3.1
3.1 Extract by enter
$tar xvjf OpenCV-2.3.1a.tar.bz2
3.2 Enter the directory
$ cd OpenCV-2.3.1/
3.3 Create a output directory
$mkdir release; cd release
3.4 COMPILE The OpenCV
This is the important one! For more information please see in Ref1 below.
$cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..
3.5 Install OpenCV
$sudo make install
In some case if you cannot compile OpenCV successfully, possibly your ffmpeg might be out-dated. Try install the latest one using instruction here:
* I also found that there is an issue between the latest ffmpeg (0.10) with opencv. At this time, I recommend to use the older version of ffmpeg instead.
3.6 Exporting Part
Part B Compile application with GCC using G++
This part is amazingly easy as eating an ice-cream!
All we have to do is to get into your project directory in Terminal, then use this command to compile your program!
-o ProgramName ProgramName.c
`pkg-config opencv --cflags --libs`
That’s it! And we can execute our program by using command:
That’s all we need to do to use OpenCV 2.0.0 on Linux system.
Part C Program Example
Example code of OpenCV application can be found on Ref1. below.