Installing openCV in Ubuntu with pandaboard part 5 – running openCV 2.3.1 examples

Screenshot - compile operncv samples

Screenshot-root@hud-desktop: ~-Downloads-OpenCV-2.3.1

The last tutorial about installing opencv in ubuntu with pandaboard 4 – compiling the opencv 2.3.1 did not complete the final compile steps, this post aims to complete that.

Continue the compiling of openCV 2.3.1

I assume you have finished the openCV compiling using cmake ., make, and make install commands in the terminal. Bear in my mind there is one thing I need to remind – be aware of the system date and time, as I left that incorrect and made some unnecessary compiling mistakes.

Screenshot-root@hud-desktop: ~-Downloads-OpenCV-2.3.1-1

The system configurations

After the ‘make install’ commands was executed, the system configurations needed to be set up.

1. use the command below to set the opencv’s lib links in opencv.conf file.

sudo gedit /etc/

adding the following link to the end of the file: /usr/local/lib

Screenshot-opencv.conf [Read-Only] ( - gedit

2. need to load the configuration file by using

sudo ldconfig

3. open another file and add the configuration file path, adding the highlighted contents as in the below picture.

sudo gedit /etc/bash.bashrc

Screenshot-bash.bashrc (-etc) - gedit

4. that’s done! Let’s launch an example to have a look if it works.

Running the example

1. make sure the build-essential is installed for opencv programme compiling, if not, using this:

sudo apt-get install build-essential

2. open the terminal, and go to the place holding the sample files, e.g. opencv-2.3.1/samples/c

3. change the target file mod, if you receive permission errors:

chmod +x contours.c

4. get the file compiled ready:

gcc -Wall -W -Werror contours.c -o contours

this command invokes the GNU C compiler to compile the file contours.c and make it an executable file called ‘contours’.

5. run the executable file contours:


dang-dang….. here it is…

Screenshot - compile operncv samples

Author: Andol Li

A HCI researcher, a digital media lecturer, an information product designer, and a python/php/java coder.

Leave a comment
Due to technical adjustments, the comment function is shortly closed and will be re-openning soon. Thanks.

Copyrights 2006-2017 © All rights reserved
Theme Tree2, re-designed by Andol Li, powered by WordPress and Bootsrap
WWW.ANDOL.ME | 浙ICP备15040508号-1
公安备案图标 浙公网安备33010602004018号
Back to top