![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176533/image.png)
Detecting Bubbles Using Image Segmentation
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'd like to segment an image similar to the following in order to count the number of "bubbles".
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149685/image.jpeg)
So far, I've tried removing the background mesh using enthropyfilt, and then I used the Canny edge detecting method to find the edges. After this I used imdilate with line structures to get:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149688/image.jpeg)
This looks reasonably close to what I want, but there are still a lot of regions that don't close, so imfill doesn't give me exactly what I want:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149690/image.jpeg)
Does anyone have any experience doing similar image processing?
0 comentarios
Respuestas (2)
Ahmet Cecen
el 2 de Mayo de 2015
Editada: Ahmet Cecen
el 2 de Mayo de 2015
Here is what worked for me for the above image:
1) Crop the scale bar.
2) Remove the shadow gradient.
3) Simple thresholding based on histogram.
4) Remove any connected components smaller than 100 Pixels.
5) Imfill the holes, including the regions that are bounded by the image borders. (Create a routine that adds a line of 1s outside the borders, 1 border at a time, then fill.)
6) Close the image with a 1 radius disk.
This I did in 2 minutes, no more time to improve on this, but I think you can take it from there, below is what it looks like at step 6. You can alter the parameters at different steps if you want each bubble to look as seperate as possible etc.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176533/image.png)
1 comentario
GERARDO TAPIA
el 10 de Mzo. de 2020
excellent job, could you help me with the code to understand better the image processing. I will really apreciate it
Image Analyst
el 1 de Mayo de 2015
Try marker controlled watershed segmentation. See Steve's demo: http://www.mathworks.com/help/images/examples/marker-controlled-watershed-segmentation.html
0 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!