Tuesday, May 10, 2011

How to install opencv2.2.0 on ubuntu 10.10

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-dev
Download the source code:
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.2/OpenCV-2.2.0.tar.bz2
Extract, 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.build
Configure, make and install:
cmake ..
make
sudo make install
To configure the library, edit the following file (might be empty):
sudo gedit /etc/ld.so.conf.d/opencv.conf
and add the line
/usr/local/lib
Then run:
sudo ldconfig
Finally, edit the file:
sudo gedit /etc/bash.bashrc
and add the following lines at the end:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

No comments:

Post a Comment