We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
video tracker area -> for sound: Blobs? (Read 1446 times)
video tracker area -> for sound: Blobs?
May 29th, 2009, 1:16am
 
heho!
..I start to be a processing-junkie, but I still have some problems.. Shocked

My project:
the camera/processing tracks a moving object (green, with a hole). If the perspective of the object changes (because of moves) the hole gets bigger or smaller. Sound should be connected to this different sizes.

I have the lonely parts (colortrack, blob-detection connected to sound), but I can't put it together logically...

please help me, if that is the right way:
1.) color tracking (for green)
2.) define an area around this colortrack for blobs-detection
(finally I want to have different color-objects, so I think its better to define an area around the colortrack, otherwise it start to jump to the other objects)
3.) blob detection in this area for the hole-size-> big blobsize=sound, small size = quiet

Is that the best way?
-> Or should I don't use the blob-detection/OpenCV?
(Is there a better size-recongnicing-code for moving elements?)
-> How can I definate an area around the tracker?
(In which part of the code I have to put this)


Sorry, for so many questions...
Thanks for any helps!

Re: video tracker area -> for sound: Blobs?
Reply #1 - May 29th, 2009, 9:32pm
 
What you can do is :
search for you color.
define the pixel area containing those color and searching for discontinuities inside this area (while linking two pixels within the green block you should not have to pass through an other color).
If you pass through on other color -> you find pixels (lines of pixels) where the whole is.
Then you can do water filling (start from the pixel you know and then grow up to till filling up to the green surface you know)
then you can get your whole

Also the size of the whole must be looked in proportion to the whole size of the object (because it will change with the distance)

That is may be not the most efficient way but you don't need to use blob and can do it quite easily may be.

Good luck ! seems fun ! Happy

Blob is may be a better way (?!)... have a try !
Re: video tracker area -> for sound: Blobs?
Reply #2 - May 30th, 2009, 12:41am
 
hey, thanks for helping me!

the problem is, that all objects looking the same, they are just marked with different little color-points. so I have to define a special area around the tracker for each color!?

my tracker follows this green point, but I didn't found a code to define a special area around this tracker. Inside this special area I thought to build the blob-detection for sound.

I like swimming pools, but I didn't really understood this water filling  Smiley
Maybe: can I take instead of the green color -> the object color? to make this water filling?

Do u know a code for this? I searched, but with black glasses.. Cool ..and found nothing..

Do u know how I can definate an area (around the tracker)?



Re: video tracker area -> for sound: Blobs?
Reply #3 - May 31st, 2009, 8:20am
 
Instead of water I should have use a name giving more results:
Flood fill
http://en.wikipedia.org/wiki/Flood_fill
There are some explanations and animations so you can see how it's working.

If you just want to know the area of the sticker appearing (sticker being one easy color to detect) then you can just use flood fill.

However if you want to know the complete area of the object were the sticker is, it should be easier to use blob detection/extraction

Blob algorithm usually first search for edges, and then apply flood fill to search for "compact" form:
http://en.wikipedia.org/wiki/Blob_detection
(the various methods names are usually different type of "differentiation" algorithm detecting edges)
Indeed edge are high frequency, and thus given filters search for high variations in 2D

and then flood fill:
http://en.wikipedia.org/wiki/Blob_extraction

So if you have one simple colored object you can easily find the edge of this shape and then just have to do flood filling.

However if the color is not an easy one you have better using the (more computational) blob extraction algo.

Given explanations are approximative and may not use the correct vocabulary so if any expert goes by don't be angry  Cheesy Grin and consider contributing to the thread  Wink

PS: flood fill on code.google.com seems to give results with java code... you could get some interesting stuff from that Happy
http://code.google.com/search/#q=flood%20fill

also the page on wikipedia seems to give links of implemented solutions !
Page Index Toggle Pages: 1