How to count and measure bubbles in foam

3 views (last 30 days)
For a newly developed experiment I need to count and measure the bubbles in the following image of a foam.
I will need to do this repeatedly which is why I would like to establish an automatic procedure. However my methods via thresholding and an imfindcircles() do not work because (as you can see) the bubbles are not uniform in shape and size. Additionally the top layer of the foam can not be isolated with my technique, so there will always be "background bubbles" behind the actual layer of interest which has caused problems in my approaches.
I hope someone can help me with finding a suitable way to detect the bubbles, count them and measure their circumference.
Thank you for your help and I am looking forward to your ideas.
PS: I have already tried to adjust the Matlab examples for cell counting, object (staples) counting and the "Marker-Controlled Watershed Segmentation" (with apples) but had no luck.

Answers (1)

Image Analyst
Image Analyst on 25 Feb 2015
That looks like a tough one. It looks like you need to rely on the fact that a bubble/cell is surrounded by a black line but the difficulty is that you have lots of spurious black lines that divide up the cell and the surrounding black lines can get pretty thin and I suspect may have breaks in them. Plus it seems like you have a lens shading or illumination problem. I'd start with an erosion or bottomhat or tophat filter. If that doesn't work you might try anisotropic diffusion (I have a demo attached if you're interested) to extend the black lines. You might have to try some kind of multi-scale algorithm to get the really big ones first, then mask them out and get the smaller ones next, and so on.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!