Bubble analysis : how to separate following bubbles ?
Show older comments
I need to study bubbles in my device, here is an example of two bubbles (they are evolving in a Hele-shaw cell).

In order to characterize them, I want to know their equivalent diameter, center, area ... For that, I was just taking the inner pixels (inside the black pixels) and was analyzing them with regionprops. Now, the bubble can also be represented with the outer radius, and I want to do a average radius, and area. So I need to characterize the inner bubble (without black borders) and outer bubble (bubble with black borders). The problem is that the border between the two bubbles is not well defined.
. In order to have that, my solution was :
- First, image thresholding, using imbinarize

- There, I can easily get information about inner diameter, center (regionprops)
- Then, imcomplement the previous image

- With this segmentation, if there is an unique bubble, it is easy to have information about the outer equivalent diameter and center, but here, I don't really know how to proceed. I tried to do a imfill with holes, but the regionprops will only find one bubble because it will appear as only one bubble.
To solve this problem, I tried the imfindcircles, who gives ok results with the previous image and finds approximatively the two circles. But now, I also have those kind of bubbles, and in this case, neither regionprops or imfindcircles works when I want to find the outer radius for each bubble.

Thanks for helping :)
Answers (1)
Akira Agata
on 10 Dec 2018
By combining some functions, characteristics (equivalent diameter, center, area...etc) of each bubble can be calculated. The following is one example.
% Import your bubble image (attached file)
I = imread('bubble.png');
Igray = rgb2gray(I);
% Binarize and remove non-target regions in the image
BW = imbinarize(Igray,'adaptive',...
'ForegroundPolarity','dark','Sensitivity',0.5);
se = strel('disk',5);
BW = imopen(BW,se);
BW = imclearborder(BW);
BW = bwareafilt(BW,[200 Inf]);
% Apply regionprops
s = regionprops('table',BW,{'Area','Centroid','EquivDiameter'});
% Visualize the result
L = bwlabel(BW);
Lrgb = label2rgb(L);
figure
subplot(1,2,1)
imshow(I)
hold on
scatter(s.Centroid(:,1),s.Centroid(:,2),'rx')
subplot(1,2,2)
imshow(Lrgb)

1 Comment
Christopher Madec
on 11 Dec 2018
Categories
Find more on Image Segmentation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!.png)