OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. It is released under a BSD license, it is free for both academic and commercial use. It has C++, C, Python and soon Java interfaces running on Windows, Linux, Android and Mac.
This is how to build and install OpenCV 2.2 on Ubuntu 10.10.
First, install the dependencies from the repositories:
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev cmake libswscale-dev libjasper-devDownload the source code:
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.2/OpenCV-2.2.0.tar.bz2Extract, create the build directory:
tar xfv OpenCV-2.2.0.tar.bz2 rm OpenCV-2.2.0.tar.bz2 cd OpenCV-2.2.0 mkdir opencv.build cd opencv.buildConfigure, make and install:
cmake .. make sudo make installTo configure the library, edit the following file (might be empty):
sudo gedit /etc/ld.so.conf.d/opencv.confand add the line
sudo ldconfigFinally, edit the file:
sudo gedit /etc/bash.bashrcand add the following lines at the end:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig export PKG_CONFIG_PATHMost of the above was find here.
Older versions? Take a look at the following links:
OpenCV 2.1 on Ubuntu 10.04 (pretty much the same as above, but with TBB)
OpenCV 2.0 on Ubuntu 9.10
For OpenCV 2.3.1 see this post.