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.
IndexProcessing DevelopmentLibraries,  Tool Development › BlobDetection library
Pages: 1 2 
BlobDetection library (Read 7830 times)
BlobDetection library
May 4th, 2005, 10:09am
 
Hello,

I've put blobDetection code I developped last year ( http://v3ga.net/show.php?id=12&type=0 ) in a library.
I've slightly changed the interface and conventions. It is possible to have a custom method to accept/reject blobs, thus allowing to filter them according to your own criterias.
The library is documented and two examples available for download are provided.
Any thoughts or comments are welcome, hope this library will be useful for the community!

http://v3ga.net/processing/BlobDetection/Library/
Re: BlobDetection library
Reply #1 - May 4th, 2005, 10:24am
 
super! will take me some days to get it up on the library page.
Re: BlobDetection library
Reply #2 - May 4th, 2005, 12:56pm
 

Hmm, I have tried out your webcam demo and I get:

java:38:3:38:43: Semantic Error: No accessible method with signature "setBlobDimensionMin(int, int)" was found in type "blobDetection.BlobDetection".


Any thoughts?
Re: BlobDetection library
Reply #3 - May 4th, 2005, 2:29pm
 
Yep, I uploaded a bad version of the .pde file with some 'experimental' functions. This should be fixed now. ( just delete the line in your case). setBlobDimensionMin(int, int) does no longer exist, and has been replaced by a mechanism who lets you filter the blobs.
Re: BlobDetection library
Reply #4 - May 5th, 2005, 6:22pm
 
So fast!  Thanks for putting that up.  I think many a folk will come to appreciate it over the coming weeks.  Certainly makes object tracking a breeze!
Re: BlobDetection library
Reply #5 - May 6th, 2005, 12:41am
 
Sometimes, after it has been running for a few seconds, it dies... gives me this error message...

Code:

java.lang.ArrayIndexOutOfBoundsException: 1726661528

followed by a long list of these:
Code:

at blobDetection.BlobDetection.computeEdgeVertex(BlobDetection.java:250)

and ending with this:
Code:

at blobDetection.BlobDetection.findBlob(BlobDetection.java:158)
at blobDetection.BlobDetection.computeBlobs(BlobDetection.java:129)
at Temporary_8659_9257.draw(Temporary_8659_9257.java:67)
at processing.core.PApplet.display(PApplet.java:1073)
at processing.core.PGraphics.requestDisplay(PGraphics.java:362)
at processing.core.PApplet.run(PApplet.java:918)
at java.lang.Thread.run(Thread.java:552)


http://www.flight404.com/processingBeta/_images/blobMe.jpg
I modified the code so that there are multiple theBlobDetection objects all set to different thresholds.  Is it possible that it would die if there were too many blobs?  Is there a cap on the number allowed?  Doesn't seem to die if I have the blur turned on reducing the total number of blobs.

Also noticed from your sample code that it works just as well (?) if you leave loadPixels and updatePixels out of the code.  Is there actually a difference in performance if those methods are left out?
Re: BlobDetection library
Reply #6 - May 6th, 2005, 1:49am
 
Hello Robert,

yes it is possible that the detection dies because of too many lines per blob (the blob number is limited to 1000 for each instance of blobDetection , ie when max numbers of blobs is encountered, the loop breaks, may be it would be good to let user set this parameter).
Each blob has a stack of 2000 lines allocated at the beginning, and the algo didn't check for overflow when running. I've quickly patched this , setting up the number to 4000 and checking for out of bounds. In this case, I think that it would lead to a 'truncated blob' as it stops. May be it would be good to have another better strategy there (ie allocate some more memory to let the detection finish for that blob).
Thanks for having pointed this out! I've uploaded a new version online :

http://v3ga.net/processing/BlobDetection/Library/jar/blobDetection.jar

Hope it will work as expected!

For loadPixels/updatePixels, there is no reason to let them there. Tongue I will update sourcecodes too on the tutorial page. Thanks for the tip!

Julien
Re: BlobDetection library
Reply #7 - May 6th, 2005, 7:57pm
 
OK. It's on the Libraries page now:
http://processing.org/reference/libraries/
Re: BlobDetection library
Reply #8 - May 6th, 2005, 9:58pm
 
so, what would one have to do to change the drawing of lines into the places of vertices within a beginShape(POLYGON).  I tried making the switch, but could not achieve the results I wanted... too many odd lines, though the effect was a bit puppetry-like.

r
Re: BlobDetection library
Reply #9 - May 7th, 2005, 11:17am
 
Thanks Casey for having posted this on the library page.

Robert, I've put up online a .pde which draws blob as filled polygons. The problem was (I think) due to blobs which were not closed, ie blobs which were cutting the borders of the image. This was resolved by adding lines on the borders of the image to process(white if you detect dark areas, white otherwise). This seems to work, even if from time to time, there are some 'glitches'. I think I will add this feature in the interface of the BlobDetection.

http://v3ga.net//processing/BlobDetection/Library/Sources/BlobDetection_webcam_testPolygon.zip

Screenshot (on a static image)

http://v3ga.net//processing/BlobDetection/Library/blobDetection_testPolygon.jpg

Re: BlobDetection library
Reply #10 - Dec 21st, 2005, 1:01pm
 
I updated the blobDetection library. Now it is possible to retrieve polygon datas (ie a list of triangles) for each detected blob in addition to its bounding box and edges list. I used this new feature in two opengl applications. You can find more here :
http://v3ga.net/blog/?p=14

Library (documentation + download)
http://v3ga.net/processing/BlobDetection/Library/

Cheers.
Re: BlobDetection library
Reply #11 - Jan 10th, 2006, 11:11pm
 
Hi,

I'm trying to run the two following examples by v3ga: "BlobDetection_Video" and "BlobDetection_Kaleidoscope"

I'm getting this error:

quicktime.std.StdQTException[QTJava:6.1.0g1], -8961=noCodeErr,QT. vers:6528000 at quicktime.std.StdQTExecption.checkError(StdQTException.java:38 )

I have quicktime 6.5 installed
QTJava

and other sketches using QTjava and Video Capture work fine.

any help would be appreciated.

thanks,
Re: BlobDetection library
Reply #12 - Jan 11th, 2006, 6:35pm
 
Hello minga,
I didn't mentionned it in the blog post, but the video provided with the examples (Video & Kaleidoscope) were created using Quicktime 7. It may be the source of your troubles... Did you try loading another video?
Re: BlobDetection library
Reply #13 - Jan 12th, 2006, 1:21am
 
good call !!!! this was exactly the problem.

Thanks for your help, and thanks a lot for sharing all these codes/library with us.

ps: I'm so dumb Wink why did'nt I tried with another video.
All these quicktime 7 thing drive me crazy.
Re: BlobDetection library
Reply #14 - Jan 15th, 2006, 11:01pm
 
Hi v3ga,

Some questions for you ;-):

1. Is that possible to set the minimun size of a blob. In order to not "compute" blob that are smaller than a defined size.

Something like:

static void setConstants(int blobMaxNb, int blobLinesMaxNb, int blobTrianglesMaxNb, int blobMinSize, int blobMaxSize)

2. In the doc you write:
"This library does not perform blob tracking, it only tries to find all blobs each frame it was fed with."

I'm not sure I get it. This library is doing blog tracking. no ? I mean with it I'm able to track a blob (in a real-time video stream), and therefore to know its coordonates, size.
What do you mean by blog tracking ? Tell me ;-)

3. Is the result I'm getting correct after doing the following initialization (see screenshot http://www.smallfly.com/v3ga_BlobDetection):

 theBlobDetection.setPosDiscrimination(true);
 theBlobDetection.setThreshold(0.9f);

shouldn't I detect only brigth blobs whose luminosity is superior to 0.9f (only white). And in this case (screenshot) only one blob and not two.

thanks,
Pages: 1 2