Color Blob Tracking

1,615 views
Skip to first unread message

tactic-...@gmx.de

unread,
Sep 4, 2011, 11:58:14 AM9/4/11
to android-opencv
Hey guys,

we're total new with Androidv/Java/OpenCV and want to do some Color
Blob Tracking with an Android Device (like http://www.youtube.com/watch?v=NkWkCpYc3CA)
to identifie a goal with our soccer playing robot (further
information: tactic-robotic.de). We modified the sample which comes
with OpenCV for Android and we already have a color - filtered image.
But now we want to get the coordinates of the largest blob, but
unfortunately there's no blobfunction with OpenCV for Android. So is
there a simple solution for us? Can we integrate a normal C++ OpenCV
blob library?

Thank you for your time :).




Kirill Kornyakov

unread,
Sep 5, 2011, 5:17:30 AM9/5/11
to android...@googlegroups.com
Do you mean 3d coordinates of an object, which is seen as the largest blob on a frame? Or you just need bounding rectangular or something like this?? Could you please say if you have stereo camera or usual monocular camera.

tactic-...@gmx.de

unread,
Sep 5, 2011, 10:10:12 AM9/5/11
to android-opencv
Hey Kirill Kornyakov,

we need the center coordinates (x,y) of the largest blob on a frame..
these coordinates will be sent to a microcontroller which uses them
for orientation (to know where the goal is)... so we need something
like real - time blob tracking.
Our device will be a normal smartphone like galaxy ace - so a usual
monocular camera. But at the moment we're testing with a galaxy tab.

Thank you for your time

On 5 Sep., 11:17, Kirill Kornyakov <kirill.kornya...@itseez.com>
wrote:

Kirill Kornyakov

unread,
Sep 5, 2011, 10:24:27 AM9/5/11
to android...@googlegroups.com
Did you try SimpleBlobDetector class? I'm not sure about its performance on a mobile device.

If your blob is a circle (a ball) you can also try to use minEnclosingCircle on the largest contour (findContours). Also check other functions from Structural Analysis and Shape Descriptors, for example moments allows you to find mass center of a blob.

-Kirill

Nicholas Cantrell

unread,
Sep 5, 2011, 12:17:01 PM9/5/11
to android...@googlegroups.com
Are you using the IOIO board from sparkfun?

On Monday, September 5, 2011, Kirill Kornyakov <kirill.k...@itseez.com> wrote:
> Did you try SimpleBlobDetector <http://opencv.itseez.com/trunk/modules/features2d/doc/common_interfaces_of_feature_detectors.html#SimpleBlobDetector> class? I'm not sure about its performance on a mobile device.
> If your blob is a circle (a ball) you can also try to use minEnclosingCircle <http://opencv.itseez.com/trunk/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#minenclosingcircle> on the largest contour (findContours <http://opencv.itseez.com/trunk/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#findcontours>). Also check other functions from Structural Analysis and Shape Descriptors <http://opencv.itseez.com/trunk/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#>, for example moments <http://opencv.itseez.com/trunk/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#moments> allows you to find mass center of a blob.

tactic-...@gmx.de

unread,
Sep 6, 2011, 11:52:26 AM9/6/11
to android-opencv


On 5 Sep., 18:17, Nicholas Cantrell <nickcantr...@gmail.com> wrote:
> Are you using the IOIO board from sparkfun?

We're using an AtMega2560 to control our robot. So the smartphone
should only detect the goal and send the information via bluetooth to
the microcontroller. But the IOIO sounds very interesting, we could
put the two things together in one. The thing is we already worked
about 2 years with the AtMega and have now experience with Java.

Detection of circles is unfortunately not useful because the goals are
rectangles. You could get a better impression if you watch one of our
videos: http://www.youtube.com/watch?v=2LRtQ9JJ4vg

I wanted to use the SimpleBlobDetection function. But how can I
implement it in my program?
When I try to write something like

FeatureDetector.DYNAMIC_SIMPLEBLOB I get errors back.
I think this comes from my bad Java knowledge....

Thanks for your help!

Kirill Kornyakov

unread,
Sep 29, 2011, 2:06:15 AM9/29/11
to android...@googlegroups.com
I found recenlty the SimpleCV project. They who create a wrapper over OpenCV and some other libs. I don't think that it is of big importance for Android developers, but they have color blob tracking example: http://www.simplecv.org/doc/cookbook.html#blob-detection.  So, you can try to study their BlobMaker class (https://github.com/ingenuitas/SimpleCV/blob/master/SimpleCV/BlobMaker.py), it uses OpenCV functionality.
Reply all
Reply to author
Forward
0 new messages