Kernel: Python 3
Counting grains and bubbles
This Scanning Element Microscopy image shows a glass sample (light gray matrix) with some bubbles (black) and unmolten sand grains (dark gray). We wish to determine the fraction of the sample covered by these three phases, and to estimate the number of sand grains and bubbles, their average sizes, etc.
Loading the slide
In [36]:
In [37]:
Remove banner
In [38]:
Filter to get rid of speckles
In [39]:
Find threshold values
In [40]:
Separate layers by thresholding
In [41]:
Visualise layers
In [42]:
Clean up shapes found
In [43]:
Label connected components
In [44]:
115 regions found in Sand
Mean obj area 1769
70 regions found in Bubbles
Mean obj area 2516
27 regions found in Glass
Mean obj area 19111