|[mmdchickparts] [Up] [mmdcookies]||Demonstrations|
This example shows an image analysis technique to detect anhydrous phase and aggregate from a polished concrete section observed by scanning electron microscope (SEM). The anhydrous phase appears as white grains while the aggregate appears in the image as an homogeneous medium-gray grains. This image was kindly provided by Prof. Gladis Camarini from FEC-UNICAMP.
The steps for this analysis are: i) anhydrous detection by automatic threshold analysis; ii) homogeneous grain detection using watershed technique; iii) aggregate are homogeneous grains that are not from the anhydrous phase. The automatic threshold analysis is done using 1D-signal morphological processing using watershed.
The SEM image of a polished concrete section is read. The anhydrous phase are the white pores, while the aggregate are the medium-gray homogeneous pores.
f = mmreadgray('csample.jpg');
The histogram has a small peak in the white region related to the anhydrous phase.
The threshold value is extracted using the watershed technique. The aim is to detect the middle valley of the histogram. If the histogram is negated, we need to extract the middle peak of the 1D signal. This is accomplished by find proper markers on the valleys. These markers are extracted by detecting the regional minima of the filtered signal (alternating sequential filtering, closing followed by opening of length 5 pixels). To discard the detection of peaks near the limits of the histogram, an intersection is done using the mmframe function. For illustrative purpose, a plot of all the signals involved is displayed.
hf = mmasf(mmneg(h),'co',mmseline(5,90));
ws = mmwatershed(hf);
wsf = mmintersec(mmneg(mmframe(ws,20)),ws);
t = find(wsf);
x = 1:size(h,1);
mmax = mmstats(h,'max');
ws_plot = mmgray(ws, 'uint16', mmax);
wsf_plot = mmgray(wsf, 'uint16', mmax);
plot(x, mmneg(hf), 'r',...
x, ws_plot, 'g',...
x, wsf_plot, 'b');
|mmneg(hf), ws, wsf|
The threshold value found in the previous step is applied. After, a filter to remove blobs smaller then 20 pixels is applied. For illustrative, the contour of the anhydrous grains are displayed as an overlay on the original image.
aux = mmthreshad( f, t, 255);
Warning: converting image from scalar to uint8 Warning: converting image from scalar to uint8
anidro = mmareaopen(aux, 20);
mmshow( f, mmgradm(anidro));
The result of the watershed in the previous step is the detection of a large number of regions. The larger ones are the aggregate and the anhydrous. So first the regions are filtered out using an area criterion of 300 pixels. Small holes (area <= 50) are closed. The aggregate is obtained by removing the anhydrous phase.
Finally each phase is measured and an illustrative display is constructed. The grains contoured by red are the aggregate and those contoured by green, the anhydrous.
n = prod(size(f));
anidro_phase = mmstats(anidro,'sum')./n;
aggr_phase = mmstats(aggr,'sum')./n;
mmshow( f, mmgradm(aggr), mmgradm(anidro));
|f, mmgradm(aggr), mmgradm(anidro)|
|[mmdchickparts] [Up] [mmdcookies]|
|Copyright (c) 1998-2008 by SDC Information Systems|