Running OpenCV on the BB

Hi,
I'm a complete newbie to the beagleboard.
I have worked on computer vision and I needed a portable system for
OCR and text-to-speech. The beagleboard seemed to be a pretty good
option. I've read a lot of the wikis and documentation but I have
worked primarily on Windows, so I'm still pretty clueless, though I'm
more than willing to switch to Linux.

My main issue is that I have developed my C++ programs using OpenCV.
How do I get that working on the beagleboard? What about the OpenCV
libraries and the API? Do I need to translate the code or can I keep
using functions like cvCaptureFromCam(0) ?

I'm really confused!! I'd appreciate any help on this topic.
Thanks,
Sam

Hi Sam,

How do I get that working on the beagleboard? What about the OpenCV
libraries and the API? Do I need to translate the code or can I keep
using functions like cvCaptureFromCam(0) ?

The following thread might be helpful for you:

Hi Andrey,

Thanks so much....you have no idea how much that helped me out!!
Just one stupid question -- it's not imperative to install the python
packages right...I mean I have no intention of using any python
scripts, so I can just skip that step right.

Thanks again :slight_smile:

Sam

Thx for your notes. when i follow your process, i got the error,
cannot find the gcc or arm-angstrom-linux-gnueabi-gcc, What can I do
now? many thanks for your reply.

Hi Sam,

Thanks so much....you have no idea how much that helped me out!!

I am glad that it was helpful for you.

Just one stupid question -- it's not imperative to install the python
packages right...I mean I have no intention of using any python
scripts, so I can just skip that step right.

I am not sure. My guess is that Python might be necessary for some GUI
staff. I would suggest to try without Python and see if it works as
you need.

Regards,
Andrey.

Hi DotDotDog, It seems u do not have toolchain. if u are on
beagleboard ... just do

opkg list | grep gcc
or
opkg list | grep arm-angstrom-linux-gnueabi

u made find which package is required

Thx for your help, I have installed the arm-angstrom-linux-gnueabi-gcc
by opkg.
after running the compile.sh, i got the error this time:
arm-angstrom-linux-gnueabi-gcc: pkg-config --cflags opencv: No such
file or directory
arm-angstrom-linux-gnueabi-gcc: pkg-config --libs opencv: No such file
or directory
arm-angstrom-linux-gnueabi-gcc: error trying to exec 'cc1': execvp: No
such file or directory

I have already opkg install opencv, but I found that there is no /usr/
local/lib generated. How to fix it? where is the opencv lib placed?

Rickey

Hello Rickey,
   Which file or directory is missing? Have you installed pkg-config?
Did you follow the doc posted earlier to the letter setting up your
environment variables?

tnx,
Don Lewis

I install opencv on BB by "opkg install opencv", but there is no /usr/
local/lib generated, and no /usr/lib/libv4/v4l1compat.so .. i wonder
how to install opencv on BB, and how to set the library.. sigh~~:(

I install opencv on BB by "opkg install opencv", but there is no /usr/
local/lib generated,

No package will create a /usr/local, since that is reserved for local installs, not system installs like packages.

and no /usr/lib/libv4/v4l1compat.so

isn't that part of the libv4l package?

Hi DotDotDog,

There is a number of packages related to opencv and you don't need
all of them.
Try to install opencv-samples like this:'opkg install opencv-samples'
You can verify installed packages by: 'opkg list_installed | more'
By default your opencv include files are in '/usr/include/opencv'
directory (highgui.h, ...)
and opencv library files are in '\usr\lib\' directory (libcv,
libcvaux2, ...)
The sample applications are located here /usr/share/opencv/samples/c
and you can run them from here as they are precompiled already
If you do 'cd /usr/share/opencv/samples/c'
and execute for example 'image' you will see a famous picture of Lena

good luck

Jan

Dear Jan,

I used the " opkg install opencv-samples" command to install opencv sample.
My Devkit8000 displays:

root@beagleboard:/usr/lib# opkg install opencv-samples
Installing opencv-samples (1.0.0+cvs20081115-r2.1) to root...
Downloading
http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv7a/base/opencv
-samples_1.0.0+cvs20081115-r2.1_armv7a.ipk
Installing libcxcore2 (1.0.0+cvs20081115-r1.1) to root...
Downloading
http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv7a/base/libcxc
ore2_1.0.0+cvs20081115-r1.1_armv7a.ipk
Collected errors:
* Package libcxcore2 wants to install file /usr/lib/libcxcore.so.2
        But that file is already provided by package * opencv
* Package libcxcore2 wants to install file /usr/lib/libcxcore.so.2.0.0
        But that file is already provided by package * opencv

It's because I run "opkg install opencv" before, so that the libxccore
cannot be installed again. Rught?

But after this, I can't find and folder mentioned in your email, no
"/usr/share/opencv", no "/usr/include/opencv", how come? so trouble to
develop software in Devkit8000.

Please help, many thanks.

Rickey

As mentioned before in an opencv thread: you need to install the development packages (e.g. opencv-samples-dev) if you want the headers as well.

regards,

Koen

Koen,

I got the following msg when running "opkg install opencv-samples-
dev":

root@beagleboard:~# opkg install opencv-samples-dev
Installing opencv-samples-dev (1.0.0+cvs20081115-r2.1) to root...
Downloading
http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv7a/base/opencv-samples-dev_1.0.0+cvs20081115-r2.1_armv7a.ipk
libcxcore-dev: unsatisfied recommendation for python-dev
libtiff-dev: unsatisfied recommendation for libgcc-dev
libglib-2.0-dev: unsatisfied recommendation for gobject-2.0-dev
libglib-2.0-dev: unsatisfied recommendation for gmodule-2.0-dev
libglib-2.0-dev: unsatisfied recommendation for libgcc-dev
......
......

but still no "opencv" folder generated. what's the problem then?

Rickey

Hi DotDotDog

opencv is a library (not an application), so will not see a folder
called "opencv"
See my previous email for location of header and lib files and example
precompiled opencv applications

good luck

Jan

Notice the first error. Looks like you need python and python-dev. You may have to install the others in turn.

Yes, I installed the python-dev, but still got problem when compiling
the Capture.c:

root@beagleboard:~# gcc 'pkg-config --cflags opencv' -g -o Capture
Capture.c 'pkg-config --libs opencv'
gcc: pkg-config --cflags opencv: No such file or directory
gcc: pkg-config --libs opencv: No such file or directory

Rickey

You're using straight quotes instead of backticks, try $(pkg-config --cflags opencv) to avoid all the quote/tick/etc problems

regards,

Koen