Extract bubble properties : problem with clusters + binarize

1 view (last 30 days)
I'm working on gas-liquid flows in a pump, and I need to extract bubbles properties from raw videos (I want to have the pdf of bubble size). Here is an example of what I need to study:
What I've done so far is:
  • Subtract the background (from a raw video with no bubbles)
  • Manual binarization (I manually choose the threshold for binarizing my images)
  • Noise reduction (If a white pixel is surrounded by two adjacent white pixels, the pixel remains white, otherwise it becomes black)
  • Detection of edges using strel morphological transform and regionprops.
The result is the following :
As you can see, it seems that my algorithm gives good results, but I have some problems :
  • Small bubbles are not detected by my algorithm even if I can see them (not visible in this picture, sorry)
  • Clusters !! You can see big areas of bubbles.
I know that I won't be able to fully characterize images and lost information on some clusters that I will not be able to characterize, but I'm sure that some improvements can be done. Here is an example of problems that happens:
It's not quite visible but I'll try to explain:
  • For the left cluster (left yellow circle), there's only 1 pixel that links the left circle and the right one but my algorithms says that this is only one bubble
  • And the big problem so far, for the right yellow part, I can see that there's 3 bubbles, but the algorithm counts only 1 ...
I know that the problems comes from the manual binarization. I tried the Otsu method (the algorithm described here ), here is the result:
As you can see, the algorithm works well with bubbles with intensity, and the clusters are less big than the previous images. Nevertheless, a lot of bubbles are not detected since the threshold is too high I think.
Finally, here is my question : What algorithm could I use to try to characterize those clusters (some sort of segmentation) ? Is the regionprops algorithm good ? Do you have some other tips (I never used imadjust, imfilter on my images, maybe I could try them) ? I think that I could use the Otsu algorithm, and try to remove the bubbles detected by this algorithm (filling those with black) and re-using the Otsu algorithm another time.
Sorry if I gave no parts of my code (a very long one), I don't think that it's useful to show him, but If you want more details, I can share him !
Thanks everyone,
  2 Comments
Guillaume
Guillaume on 24 Jul 2018
It looks to me that your first algorithm is good at detecting the bubbles that are out of focus (which have lower contrast) and doesn't work with the in focus bubbles. Your second algorithm on the other hand works well on the in focus bubbles.
Can't you discard the large clusters from both and then join the two sets? It should give you most of the bubbles.
The density of the bubbles will make it difficult to extract individual ones. What's the depth of field of your imaging system? Can you reduce it?
Christopher Madec
Christopher Madec on 24 Jul 2018
Edited: Christopher Madec on 24 Jul 2018
Hi Guillaume, thanks for your answer.
I could discard the large clusters (maybe with the Image Region Analyzer by deleting manually the big clusters), I'll have a try.
The second algorithm, based on Otsu's Method, only works with bubbles with high luminosity (maybe also in-focus bubbles, I'll do some over experiments by reducing the depth of field).
The problem in both algorithms stays the same : I can't decluster some parts (as showed with the yellow circles ones), even if it seems that I'm able to see by myself how many bubbles there are in clusters - not all of them, I know that some big clusters are definitively impossible to analyze -). And small bubbles remains impossible to detect with those two algorithms.
I agree with you that each algorithm gives different results that I could mix in order to be able to have better results ;) (leading to another question : How could I mix those results ... ?)

Sign in to comment.

Answers (1)

Abhishek
Abhishek on 28 Apr 2024
hi, you can use methods like..rolling ball algorithm, adaptive thresholding and lastly watershed to revmove the cluster,

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!