2012-01-05

Compiling OpenCV under Linux/Ubuntu

A tutorial on how to install and start developing OpenCV applications under Ubuntu/Linux with example code.
Installation
Installation guide found on:
http://opencv.willowgarage.com/wiki/InstallGuide

*) Install the development packages and other possible required packages
$ sudo apt-get install libcv-dev libcvaux-dev libhighgui-dev libbz2-dev

*) One might need the bz2-libs as well, which can be downloaded from
http://pkgs.org/download/bzip2-libs

*) Install cmake
$ sudo apt-get install cmake

*) Download the source (Currently OpenCV-2.3.1a)
$ svn co https://code.ros.org/svn/opencv/trunk/opencv
$ cd opencv
$ mkdir release
$ cd release
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..
$ make
$ sudo make install

*) Make sure you have /usr/local in your PATH and /usr/local/lib in your LD_LIBRARY_PATH (or in your ~/.bashrc file
$ export PATH=$PATH:/usr/local/lib:/usr/local
$ export LD_LIBRARY_PATH=/usr/local/libSimple test program
This is a simple program for testing my opencv installation. It should load an image, create a window containing the input from the first available camera unit and display it on the screen. It was the first program i wrote and was never intended to be used in demonstration purposes and should thus only be viewed as an of-context reference to some of the opencv features available.

Use
$ ./run.sh
To compile and run.

https://sites.google.com/site/wessmansourcecode/opencv.example.tar.gz

No comments:

Post a Comment