You are on page 1of 4

Applied Mineralogy, Pecchio et al.

(eds) 2004 ICAM-BR, São Paulo, ISBN 85-98656-01-1

Automated, Adaptive Thresholding Procedure for Mineral Sample


Images Generated by BSE Detector
C.L.Schneider, R.Neumann & A.Alcover-Neto
SCT - Setor de Caracterização Tecnológica, CETEM - Centre for Mineral Technology, Rio de Janeiro, Brazil

ABSTRACT: The relationship between average atomic number, BSE detector response, brightness and
contrast is fairly well understood. However, it is difficult to positively threshold BSE images due to
extraneous factors, such as the presence of edge pixels that usually present an intermediate gray level between
the neighboring phases, and due to complex variations in chemical composition that can be observed in a
single mineral. The presence of phases with similar average atomic number is another factor that complicates
effective thresholding, and sometimes these phases cannot be resolved in the image histogram. It is
reasonable to assume that a single phase/mineral will generate a Gaussian distribution of detector responses.
A more realistic mineral will generate a distribution of gray levels that is better modeled by a combination of
Gaussians, as its chemical composition vary spatially with a range of defects, substitutions, alterations and
solid solutions. Another difficulty is to maintain constant contrast and brightness throughout a set of images
of mounted particle specimens. Usually, contrast and brightness will only remain constant under very strict
conditions. In this work, an automated adaptive thresholding procedure, that allows for the most commonly
found phase variations and that self adjusts for changes in brightness and contrast, is implemented. The
procedure is based on individual phase models represented by sums of Gaussians. The procedure is tested in a
complex copper ore containing magnetite, chalcopyrite and silicates.
1 INTRODUCTION Therefore, BSE imaging is the preferred source of
mineralogy data. A typical BSE image is shown in
Automated image processing is not only convenient, Figure 1.
but necessary. In order to obtain statistically smooth
distributions from particle cross-section
measurement, it is necessary to process thousands of
cross-sections, in sets of images that contain
anywhere from 20 to 100 images. Depending on the
complexity of the mineralogy, the processing and
thresholding procedures may involve several steps
such as filtering, fingerprinting, watershed feature
separation, area, linear and perimeter measurements.
Reproducing all these steps manually for say 50
images is error prone, and boring. Furthermore, a
particle sample is usually split into several narrow
sized samples, and each of the sizes imaged,
processed and measured. This generates anywhere
from five to ten specimens for the average mineral
processing plant stream. This may very well be the
case for field and laboratory samples. The result is
that the microscope operator is commonly presented Figure 1: A BSE image showing epoxy (Ep), three different
silicates (Si1, Si2 and Si3), magnetite (Mt), chalcopyrite (Ch)
with jobs that involve processing 500 images. When and a spec of a monazite (Mz). Particles are in the 104x75 µm
back-scattered electron images can be used for size range.
positive mineral identification and thresholding,
acquisition time is significantly reduced. Another
advantage is the relative low cost of and simplicity The dependence of detector response on the
of a BSE detector relative to EDS and WDS. average atomic number of the phases is readily

103
noticeable. BSE response increases from epoxy to 2 A MODEL FOR THE INTENSITY
the various silicates, then magnetite, chalcopyrite HISTOGRAM
and finally the monazite, with the brightest phases
corresponding to those of more intense BSE Each phase in a BSE image produces a peak at a
response. The gray level histogram for this image is mean position, and with an area under the peak that
shown in Figure 2. is equal to the proportion of the phase in the image.
Here we will refer to the total count as the volume
fraction of the phase times the number of pixels in
the image, since the images are from particle cross-
10000 sections, and the first law of stereology is assumed
9000 to apply. The third variable is the peak’s variance,
8000 and this is a function of composition changes within
7000
a phase, detector resolution, beam stability, etc. The
first concern is to predict where the mean value of a

Frequency
6000
phase peak will be located in the histogram. Harding
5000 Si 2 Mt (2002) has made an important contribution in
Ep
4000 Si 1 describing how this problem can be equated using
3000 the average atomic number of the phase, and the
2000 Ch
contrast and brightness at acquisition time.
Si 3
1000
Harding’s work is partially based on data gathered
Mz here, aimed at describing how atomic number and
0
0 50 100 150 200 250 mean gray level behave in BSE images, as shown in
Intensity
Figure 3.
Figure 2: Intensity histogram corresponding to the BSE image
in Figure 1. 300

250 Au Bi
W
Hf Pt
Ta

This intensity histogram has been clipped at 200 Sb

Grey level
Cd
Pd Ag Sn

10,000 counts to enhance the smaller peaks. The 150


Y
Zr
Nb
Mo
Ge Se
smallest count between chalcopyrite and magnetite Fe
Co
Cu
Ni
Zn
V CrMn
is registered at intensity 183, and for chalcopyrite 100 Ti

and monazite at 220. These are good thresholding 50 Al


S
Si

values to separate the chalcopyrite from the other C


Mg

0
phases in the image. The problem is that, during
0 20 40 60 80 100
acquisition, contrast and brightness may change, so
Atomic number
for the next image in the set these values will be
different, and an automated procedure is required to Figure 3: Mean gray level versus atomic number at constant
find the best thresholding values for all images in the brightness and contrast.
set, without operator interference.
Global automated thresholding procedures such
as Otsu (1979) and maximum entropy (Pun 1981) Samples of 31 different elements, from carbon to
are just not appropriate for such complex gray level bismuth, were mounted in epoxy and BSE imaged
histograms. Complex procedures such as split-and- with an aluminum standard. For all 31 images, the
merge and region growing, used in robotics, may epoxy and aluminum peaks were set at a constant
very well work, but the alternative presented in this position, ensuring constant brightness and contrast,
work is more attractive: a method to model the and the average gray level of the element noted. The
histogram that is constrained by the average atomic resulting plot shows linear behavior at low atomic
numbers and logarithmic behavior at higher values
number of the phases. The main advantage is that a
of Z. With this data, Harding developed a model
global analysis of the histogram also provides
based on an auxiliary variable S, defined as:
information such as the probability that a pixel
belong to a specific phase or another, or none, the
 Z
variance of the composition of a phase, preliminary  + ln(Z ' ) − 1 Z ≤ Z'
volume fraction assessment, complex processing S = Z' (1)
sequences for multiphase systems, etc. However, all  ln(Z ) Z > Z'
these aspects are not explored in this paper, and the
primary objective here is to present a working model where Z is the atomic number of the element. Here,
and test it for a real set of images from a mineral we’ve found the value of Z’ to be 19.75. The value
sample. of S varies linearly with contrast and brightness, i.e.

104
I =C S+B (2) each phase, as well as C and B. The SQP procedure
allows for upper and lower bounds for each
where I is the gray level intensity, C is the contrast optimization variable, and in this implementation,
and B is the brightness level. When a mineral instead each volume fraction is bounded within the [0,1]
of an element is imaged, Z can be substituted by the grade interval. Bounds for the variances are difficult
phase’s mass weighed average atomic number in to assess without experiencing with the model, so at
equation (1). The implication is that for known C implementation, the bounds were set at very wide
and B, the mean of a peak in the global histogram is intervals, equal to the domain of an entire histogram,
[0,256]. In practice these bounds are not restrictive
defined if the phase’s composition is known.
at all, and the volume fractions and variances may
The histogram model requires a distribution of
assume any possible/practical value. One equality
intensities around the mean values. At this time, it is
constraint was implemented,
not known what probability function would be the
most appropriate to describe this distribution. The
Gaussian distribution function was used here ∑v
j
j =1 (4)
because it has all the desired properties. It is not
necessary, for the purpose of determining the best
thresholding point, that the histogram model be and this is straight forward. Bounds for contrast and
completely accurate, and the exact shape of the brightness were also implemented, and the actual
peaks in the model may differ from the actual values are discussed in the experimental session.
histogram, as long as the mean values are in the right
position. The complete cumulative histogram Hx is
therefore modeled by a sum of Gaussians, each 4 EXPERIMENTAL
Gaussian with an arbitrary variance, and weighed by
the volume fraction of phase in the image, i.e. In order to test the thresholding procedure, a copper
ore sample from northern Brazil was prepared by
hand crushing followed by wet grinding in a rod mill
Hx = N ∑v
j
j Gx ( µ j ,σ j ) (3)
at 50% solids for 15 minutes. The ground product
was wet sieved immediately after grinding to avoid
sulfide oxidation. The various size fractions were
where vj is defined as the volume fraction of phase j,
dried under vacuum, embedded in epoxy, polished
µj its mean intensity and σj its variance. N is the total
and carbon coated. Fifty-eight images were acquired
number of pixels in the image. Cumulative
from the 104x75 µm mound, using a solid-state
distributions are required because the measured
back-scattered electron detector on a LEO S440
histogram is discrete, and the model histogram is
SEM. Contrast and brightness were set to ensure
continuous. Substituting Equation (2) into Equation
good phase resolution between the gray levels of
(3), we get
chalcopyrite, and the other phases, magnetite and
silicates (mainly chlorite, amphiboles and pyroxene).
Hx = N ∑v
j
j G x ( C S j + B, σ j ) (4) One of the images in the set is shown in Figure 1
and its histogram in Figure 2. For this image, the
mean of the chalcopyrite peak is located at gray
and the histogram model is complete. level 193 and the magnetite is located at 165. These
values were obtained simply by locating the cursor
at the tip of each peak in MMIA’s graphics canvas,
3 PROCEDURE IMPLEMENTATION and reading the corresponding values. The average
atomic number of chalcopyrite (CuFeS2) is 23.544
The thresholding procedure was implemented in and of magnetite (Fe3O4) is 21.025. These values are
MMIA, Minerals and Metallurgical Image easy to calculate, and MMIA has an average
Analyzer (King & Schneider 1993). The values of atomic number calculator, for convenience. Quoting
contrast and brightness, and the volume fractions Harding (2002) “Howell et al. (1998) found that
and variances of all phases are obtained by Castings method of mass weighting the atomic
minimizing the sum of squares of residuals between numbers gave the best results”.
the model and the measured histograms for any
given BSE image. The optimization procedure used
N i Ai Z i
is based on Sequential Quadratic Programming, and Z =∑ (5)
allows for equality constraints as well as bounds for N i Ai
each optimization variable (Schittkowski 1985). The
number of parameters to be optimized is 2n+2, with This is the procedure adopted in MMIA’s average
n equal to the number of phases in the model. A atomic number calculator. The corresponding S
variance and a volume fraction are calculated for values are calculated using Equation (1), and for the

105
chalcopyrite S = 3.1589 and for the magnetite S = 90000

3.0457. The two values of S combined with the 80000

mean intensities from the histogram are sufficient to 70000

calculate the contrast and brightness, using Equation 60000


(2). For the image in Figure 1, C = 208.82 and B = -

Frequency
50000
466.63. These values of C and B define the average 40000
atomic number of every phase in the image, by using 30000
the procedure described above in reverse order. The
20000
values obtained are shown in Table 1.
10000

Table 1: Calculated average atomic numbers of the phases with 0 50 100 150 200 250
unknown composition in the image in Figure 1. Intensity

Ep Si1 Si2 Si3 Mz Figure 4: The measured histogram (dotted line) and the fitted
histogram using sums of Gaussians (solid line) for the BSE
I 31 70 85 105 233 image in Figure 1.
S 2.38 2.57 2.64 2.74 3.35
Z 7.9 11.59 13.01 14.9 28.51 The comparison shows a very good fit, and this is
a good indication that the shape of the Gaussian is
sufficient to describe a real histogram.
The values of average atomic number in Table 1,
Another interesting result is shown in Figure 5.
together with those for chalcopyrite and magnetite
How does contrast and brightness change during
were used to define the seven phases in the
acquisition?
histogram model. For all 58 images, the initial
values of C and B were set equal to the calculated
values for the image in Figure 1. The upper and
lower bounds for C and B were set at ± 10% of the 255 -589
initial values. The initial values of variance were set 254 -591
at 5 for all phases. The initial values of the volume
253
fractions for each phase were obtained from the -593
252
image in Figure 1, without much care for precision, -595

Brightness
Contrast
251
but satisfying the equality constraint in Equation (4). -597
250
The values entered were vEp = 0.5, vSi1 = 0.06, vSi2 = -599
249
0.06, vSi3 = 0.03, vMa = 0.32, vCh = 0.02 and vMz = -601
0.01. 248

A macro was written for MMIA to read an 247 -603

Contrast
image, run a 3x3-delineation filter, calculate the 246
Brightness
-605

histogram of the delineated image and then fit the 0 10 20 30 40 50 60

histogram with the phases defined above. The Image #

routine returned two segmentation levels, one Figure 5: Variation of C and B with acquisition time.
between the epoxy and the first silicate and one
between the chalcopyrite and the magnetite. The
criterion for the thresholding point was to find the 6 REFERENCES
smallest frequency in the measured histogram
between the positions of the two adjacent phases.
The macro was run for all 58 images in the set Harding,D.P. 2002. Mineral identification using a scanning
electron microscope. Minerals and Metallurgical
and the results noted.
Processing, 19(4): 215-219.
Howell,P.G.T., Davy, K.M.W and Boyde, A., 1988. Mean
atomic number and backscattered electron techniques.
5 RESULTS, DISCUSSION AND Mineralogy Mag., 51: 3-19.
CONCLUSIONS King,R.P. and Schneider,C.L. 1993. An Effective SEM-Based
Image Analysis System for Quantitative Mineralogy,
The most important result to report is that the KONA, 11: 165.
thresholding points returned by the routine were Otsu,N. 1979. A Threshold Selection Method from Gray-Level
Histogram. IEEE Trans. Image Processing, 2(2): 62-66.
correct for all images in the set. This is a good Pun,T. 1981. Entropy thresholding: a new approach Comput.
indication that the approach is correct. In order to Vision Graphics Image Process, 16: 210-239.
verify how the model fits the data it is necessary to Schittkowski,K. 1985. NLPQL: A Fortran subroutine for
plot an interpolated histogram against the measured solving constrained nonlinear programming problems,
histogram. This is shown in Figure 4. Annals of Operations Research, 5, 4850-5000 (1985/86).

106

You might also like