OpenCV is a computer vision library originally developed by Intel. It is free for commercial and research use under the open source BSD license. The library is cross-platform. It focuses mainly on real-time image processing; as such, if it finds Intel's Integrated Performance Primitives on the system, it will use these commercial optimized routines to accelerate itself.
OpenCV's application areas include:
* 2D and 3D feature toolkits * Egomotion estimation * Face Recognition * Gesture Recognition * Human-Computer Interface (HCI) * Mobile robotics * Motion Understanding * Object Identification * Segmentation and Recognition * Stereopsis Stereo vision: depth perception from 2 cameras * Structure from motion (SFM) * Motion Tracking
To support some of the above areas, OpenCV includes a statistical machine learning library that contains:
* Boosting * Decision Trees * Expectation Maximization * k-nearest neighbor algorithm * Naive Bayes classifier * Artificial neural networks * Random forest * Support Vector Machine
Assuming that you already have the Ubuntu Linux running on your board, you can use this wiki page to guide you to get your USB camera running on your system in order to use real time image processing features of this library.
In a brand new installation of Ubuntu some libraries is not installed by default, so you need to install them by your own hands (use synaptic to do that), here is the list of these libraries:
If you already have some of those libraries installed, make sure that is the DEV version.
After installing those libraries you can download the stable OpenCV version here.
Install it following the procedure below:
1 - untar the opencv package
tar -xvzf opencv-1.1pre1.tar.gz
2 - change to OpenCV folder
3 - configure the installation enabling gstreamer and letting to compile demo apps later
./configure --with-gstreamer --disable-apps
You will get the following results:
General configuration ================================================ Compiler: g++ CXXFLAGS: DEF_CXXFLAGS: -Wall -fno-rtti -pipe -O3 -fomit-frame-pointer PY_CXXFLAGS: -Wall -pipe -O3 -fomit-frame-pointer OCT_CXXFLAGS: -fno-strict-aliasing -Wall -Wno-uninitialized -pipe -O3 -fomit-frame-pointer Install path: /usr/local HighGUI configuration ================================================ Windowing system -------------- Use Carbon / Mac OS X: no Use gtk+ 2.x: yes Use gthread: yes Image I/O --------------------- Use ImageIO / Mac OS X: no Use libjpeg: yes Use zlib: yes Use libpng: yes Use libtiff: yes Use libjasper: yes Use libIlmImf: no Video I/O --------------------- Use QuickTime / Mac OS X: no Use xine: no Use gstreamer: yes Use ffmpeg: no Use dc1394 & raw1394: no Use v4l: yes Use v4l2: yes Use unicap: no Wrappers for other languages ========================================= SWIG Python no Octave no Additional build settings ============================================ Build demo apps no Now run make ...
4 - Build OpenCV
5 - Install OpenCV
./sudo make install
if all steps above were executed properly, now you can compile the sample applications:
1 - change to samples/c directory
2 - change the build_all script mode to +x
chmod +x build_all.sh
3 - run the script
Now you can test. The results below were taken from the Laplacian filter sample processing in real-time images grabbed from an USB camera:
Also, you can see how is it performance on a 3 windowed application performing color conversion and canny edge detection at the same time: