Society of Robots - Robot Forum

Software => Software => Topic started by: legsmacgee on June 24, 2008, 09:46:04 AM

Title: Blob Detection
Post by: legsmacgee on June 24, 2008, 09:46:04 AM
 :-* Hello All,

I've been working on a blob detection program for live video in java.  At the moment, my blob detection algorithm is finicky at best.  The tutorial for blob detection and middle mass location looks good, but it seems like it can only look for blobs along one row of pixels.  It looks for groups of pixels within the threshhold on that one row, and then looks for new blobs on the next row.  It doesn't account for blobs that take up more than one row of pixels.  I've been trying to compensate for this by testing the pixels one row up and 5 columns right to see if it is within the threshold, and if it is, don't register as a new blob, but its not really working too well.  Can anyone give me a good method for what I am trying to do?  Is it just noise in the image that is giving me problems? (with one blob I'm registering hundreds)

Thanks!

--Legs
Title: Re: Blob Detection
Post by: airman00 on June 24, 2008, 10:39:07 AM
have a look at roborealm , good image processing , maybe it will give you ideas or maybe you will just use that

search roborealm on google
Title: Re: Blob Detection
Post by: hgordon on June 24, 2008, 10:40:50 AM
Here's the blob detection source code used in CMUcam - you shouldn't have too much trouble converting from C to Java -

    http://www-2.cs.cmu.edu/~jbruce/cmvision/
Title: Re: Blob Detection
Post by: benji on June 24, 2008, 11:39:49 AM
well, is it greyscale frames?
anyways
you need to define a blob to build the appropriate algorithm
in your program i guess you are defining blob as this
(( more than n pixels that are all above some threshold and right after each other))
right? so u did build an algorithm on that basis
,,i guess you should know now what you wanna search for in a 2d image to build the algorithm
circle? rec? triangle? random blob? a more than 4 pixels by 4 pixels above threshold?
Title: Re: Blob Detection
Post by: benji on June 24, 2008, 11:44:04 AM
Quote
  Is it just noise in the image that is giving me problems? (with one blob I'm registering hundreds)

tolerate 90% of pixels in the area to be above threshold and consider it a blob
Title: Re: Blob Detection
Post by: Admin on July 03, 2008, 04:06:20 PM
Sounds like you aren't sorting your matrix properly . . .

Just go through each pixel, run a binary threshold, then average the pixel locations above that threshold.

(but of course, this assumes there is only one blob . . . for more blobs, its more complicated)
Title: Re: Blob Detection
Post by: vidam on July 03, 2008, 07:45:47 PM
Sounds like you aren't sorting your matrix properly . . .

Just go through each pixel, run a binary threshold, then average the pixel locations above that threshold.

(but of course, this assumes there is only one blob . . . for more blobs, its more complicated)

For more blobs with the same colors, you should use recursive region growing to encapsulate the whole blob  in a rectangular area.