Friday 21 June 2013

OpenCV configuration notes

While RPi is compiling the OpenCV source files, I take the opportunity to read the instruction to configure the OpenCV thing.


Raspberry Pi + OpenCV POSTED BY MICHAEL ON JUN 14, 2012

http://mitchtech.net/raspberry-pi-opencv/

...

*** Configure ***

Finally, we need to make a few configurations for OpenCV. First, open the opencv.conf file with the following code:

sudo nano /etc/ld.so.conf.d/opencv.conf

Add the following line at the end of the file (it may be an empty file, that is ok) and then save it:

/usr/local/lib

Then edit the system-wide bashrc file:

sudo nano /etc/bash.bashrc

Add the following new lines to the end of the file:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig 

export PKG_CONFIG_PATH


*** Comments ***


Pete FEBRUARY 8, 2013

There is a small mistake in the step where you change the system-wide bashrc:
“PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig export PKG_CONFIG_PATH”

How it should be:

“PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH”

“export” needs to be on the second line otherwise you get a ton of console spam and an error from that bashrc…

...

mrshu MARCH 1, 2013

Also, you need to run `sudo ldconfig` after you add anything to /etc/ld.so.conf.d/opencv.conf


*** C Demos ***

Now that everything is installed and configured, on to the demos!  The C demos are here:

cd ~/opencv/OpenCV-2.3.1/build/bin

C demos in build/bin demos worth checking out (that don’t require a webcam):

convexhull

kmeans

drawing


*** Python demos ***

The python demos are located in samples/python:

cd ~/opencv/OpenCV-2.3.1/build/bin

These demos also don’t require a webcam:

python ./minarea.py

python ./delaunay.py

python ./drawing.py

.END

No comments:

Post a Comment