Looking for the best possible way to analyze this picture

I’m looking to isolate two regions and find the area of the air bubbles like below.

The problem I am running into is the threshold part. I feel there is a more accurate way of analyzing the pictures.
Any feedback is appreciated.

Hi @FirstImagej

Just a quick response at the moment… you can take a look at MorphoLibJ and Morphological Segmentation. Perhaps those plugins have some tools to help you in this.


Hey thanks for the response. I’ve been messing around with the plugin for a little bit now. The attribute filter seems to be what i’m looking for. It is finding almost all of the air pockets. Would you happen to know if you can pull any information from the filter?

What exactly do you mean by that? Are you looking for some measurements of the bubbles, if so which quantities are you interested in?


yes, attribute filtering seems to be quite adapted to this situation.

I would suggest using “Top Hat” attribute filtering -> this will result in an image with air bubbles as bright object, and the rest of the image as dark object.
You can also use the “box diagonal” criterium. It will enhance blob-like structures, while removing thin elongated objects (contrary to the “area” criterium).

A good reference about attribute filtering is the following: Breen, E. J. & Jones, R. (1996). Attribute opening, thinnings, and granulometries. Computer Vision and Image Understanding, 64(3), 377–389.

1 Like

This is exactly what I was looking for. Thank you for your input, it was greatly appreciated, and helped a lot.