loading
 
Measure Blob Size
Anonymous
5 years
Is there a way to measure the size of a blob (amount of pixels) and output that to a variable.
I'm using a Kinect with an RGB filter to output white blobs on a black background

All the blobs will be different shapes and sizes so don't want to use object recognition. I need to be able to count the amount of blobs 'blob_count 'and also count the amount of blobs over a certain size.

something like:

    if size_of_blob > 1234 then

    too_large = too_large + 1
Steven Gentner from United States  [1370 posts] 5 years
Yes, there are several ways to do this. First you can check out the blob_filter and specify a size that is greater than 1234 which will cause the resulting number of blobs to all be > 1234.

Or you can add the Geometry_Statistics module, select "Individual Blobs" which will then create an array for each statistic. One of those is AREA which will have the size of the blob in it. You can either process that array using one of the scripting modules or request that via the API into another application. See attached for the VBScript example: Note that AutoThreshold is used to create the initial blobs ... most likely you don't need that.


program.robo
Anonymous 5 years
Thanks for that. The 'AREA' variable in Geometric_Statistics was exactly what I was looking for.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index