color ball tracking with opencv on BBB

Hi,

I need to implement tracking of color ball with opencv on BBB.
I have a rev.C BBB with latest (default Debian) including opencv 2.3.1
On my desktop Ubuntu I have installed opencv 2.4.9
To check the initial performance I used the example webcam program from the book “Practical OpenCV” listing 4-4 p.34 playing
the video from USB camera (Logitech C920)
I need a resolution of 640x480.
The problem is with a speed on BBB, having a significant delay. It’s good on a desktop PC.

I would like to ask for advice how to improve the performance on BBB if possible.

Jan

You’re desktop PC is > 10 times faster than the Beaglebone processor.

This may help: How to Achieve 30 fps with BeagleBone Black

Thanks for that link, it is very usefull.
In a meantime my attempt to install a newer version of opencv (following the instructions from here http://robertcastle.com/2014/02/installing-opencv-on-a-raspberry-pi/0) has failed firstly with cmake-curses-gui not working (empty database?) and after that (using command line cmake) the building stopped with a error message of not enough memory.
Jan

I’m not sure that newer open cv can be compiled on the raspberry or beaglebone due to the limited ram. You’ll probably have to cross compile.

IN case this information is useful. Derek Molloy on youtube did a video on this several months ago. He used the Logitec C920 i think it was.

And, here are some compile flags you’ll want to include/force: http://www.eliteraspberries.com/blog/2013/09/cflags-for-numerical-computing-on-the-beaglebone-black.html

I was able to build and install the same version of openCV (2.4.9) on BBB debian as on my desktop Ubuntu by using an external USB memory stick.
Now I have a problem with changing CPU frequency (as I would like to increase it from 300MHz to 1GHz)

debian@beaglebone:~$ cpufreq-info
cpufrequtils 008: cpufreq-info © Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: generic_cpu0
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 300 us.
hardware limits: 300 MHz - 1000 MHz
available frequency steps: 300 MHz, 600 MHz, 800 MHz, 1000 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 300 MHz and 1000 MHz.
The governor “ondemand” may decide which speed to use
within this range.
current CPU frequency is 300 MHz.
cpufreq stats: 300 MHz:97.20%, 600 MHz:0.20%, 800 MHz:0.06%, 1000 MHz:2.55% (35)

debian@beaglebone:~$ sudo cpufreq-set -g GOV
Error setting new values. Common errors:

  • Do you have proper administration rights? (super-user?)
  • Is the governor you requested available and modprobed?
  • Trying to set an invalid policy?
  • Trying to set a specific frequency, but userspace governor is not available,
    for example because of hardware which cannot be set to a specific frequency
    or because the userspace governor isn’t loaded?
    debian@beaglebone:~$

What am I doing wrong?

Jan

I was able to build and install the same version of openCV (2.4.9) on BBB debian as on my desktop Ubuntu by using an external USB memory stick.
Now I have a problem with changing CPU frequency (as I would like to increase it from 300MHz to 1GHz)

debian@beaglebone:~$ cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: generic_cpu0
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 300 us.
hardware limits: 300 MHz - 1000 MHz
available frequency steps: 300 MHz, 600 MHz, 800 MHz, 1000 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 300 MHz and 1000 MHz.
The governor “ondemand” may decide which speed to use
within this range.
current CPU frequency is 300 MHz.
cpufreq stats: 300 MHz:97.20%, 600 MHz:0.20%, 800 MHz:0.06%, 1000 MHz:2.55% (35)

debian@beaglebone:~$ sudo cpufreq-set -g GOV
Error setting new values. Common errors:

  • Do you have proper administration rights? (super-user?)
  • Is the governor you requested available and modprobed?
  • Trying to set an invalid policy?
  • Trying to set a specific frequency, but userspace governor is not available,
    for example because of hardware which cannot be set to a specific frequency
    or because the userspace governor isn’t loaded?
    debian@beaglebone:~$

William just explained how to do this earlier today:

sudo cpufreq-set -g performance

Regards,
John

$ cpufreq-set --help. You may need to set you profile limits/ performance is default 300MHz to 1Ghz just like ondemand, but for some reason it is always 1GHz whenever I look.

From memory setting profile limits would be like this

You change to a profile via
$ sudo cpufreq-set -g <govenor_name>

Check profile limits

$ sudo cpufreq-info -p

Change minimum profile range

$ cpufreq-set -d 1000000 /*set minimum processor freq for active profile to 1 GHz */

I do not know if these setting persist across reboots, but I think not. At least it did not see that was for me. Also settings seem to be a bit quirky. On one of my Linux support system for instance, manually changing anything did not work as expected. I could change profiles, governors etc, but actual frequency always stayed the same. Then with BBB when you set minimum ondemand profile to 1Ghz, it does not take. But when changing to performance profile, minimum freq is 300Mhz, but when you check actual processor freq it is 1Ghz . . .

So yeah, anyhow the program is quirky.

Oh, and for the uninitiated . . . setting your governor to performance / 1Ghz all_the_time may not be a very good idea. For instance it has been in the mid to upper 80’s F outdoor ambient here, and I’ve noticed my BBB getting pretty warm.

Or, cpufreq-set -f 1GHz

That works.
Another question is how to clone or replicate BBBs eMMC? How to move it into microSD card and vice versa?
If I need to have exactly the same image on another BBB as the one I am currently working on (when it’s finished) what is the procedure then?

Hi all…I want to perform Image processing tasks in BBB which runs Debian Linux… so I need to install OpenCV on BBB… It seems i should install cmake in prior… I dont have direct internet connection to my BBB… I tried to download OpenCV from github.com as a ZIP file and i copied it to BBB using pendrive…Can anyone please guide me how to install cmake on BBB?? i tried to download cmake and ended up in incomplete build… please help me … your ideas will be really appreciated

Thanks in advance :slight_smile:

Seems like a lot of work! Use an indirect internet connection to your beaglebone using the USB to your computer, then set up a bridge between your internet and the USB connection.

That works.
Another question is how to clone or replicate BBBs eMMC? How to move it
into microSD card and vice versa?
If I need to have exactly the same image on another BBB as the one I am
currently working on (when it's finished) what is the procedure then?

Can you start a new thread when you ask a new (not really related) question?

I see some places this wasn't answered, but here's where I tried to address
the issue:
http://beagleboard.org/Community/Forums?place=msg%2Fbeagleboard%2F5Xk212VcTJM%2FN7vwvZcSbWMJ
http://elinux.org/BeagleBone_Black_Extracting_eMMC_contents

More recently,
http://elinux.org/BeagleBone_Community#Board_recovery_and_Flashing_Images_on_BeagleBone
was updated with:
http://www.dc-computing.com/CloningCustomizedBeagles.html