Overview
The proposed scheme can be divided in four steps:
-
1.
Obtaining an image (or series of images) of the desired steel in the mesoscopic level.
-
2.
Converting the image (or series of images) into binary images.
-
3.
Measuring the required quantities.
-
4.
Computing the microstructural parameters relevant to the abrasive wear behavior of the alloy.
As in every microstructural/stereological analysis, the first step is to obtain good quality micrographs. Given the small size that the carbides in these tool steels might have, scanning electron microscope (SEM) micrographs are employed. These are to be taken from different sectors of the sample to secure good representation of the overall structure. It is noteworthy that the lighting conditions must be as constant as possible within each image as well as over the batch to avoid errors in the analysis stage.
The second step, as discussed above, is importing the image batch to the image analysis environment, where the intensity information of each pixel and its surrounding is used to create a binary, i.e., black and white (B&W), version of the microstructure.
Finally the B&W pictures are easily characterized through a series of algorithms that profitably use the matrix nature of such image files.
All operations, transformations and measurement methods employed to realize this approach have been tested extensively in the scientific literature and are extremely simple to understand and implement. As it will be detailed in the following sections, the result is a fast and reliable tool for processing and characterizing different microstructures.
Conversion of the Mesoscale Micrographs into Binary Images
SEM captures are usually exported into grayscale 16-bit Tagged Image File Format (TIFF) image files, in which the value of each pixel ranges between 0 (for black) and 65535 (for white). The proposed method is based on both the topological and the matrix representation of black and white images. Such images are called binary images and are created by conveniently adopting 0 (for black) or 1 (for white) for each pixel of the image, according to the value of the original grayscale micrograph. This approach obviously requires the adoption of a threshold, defining which shades of gray belong to the black, i.e., “0” group, or to the white, i.e., “1” group. This is achieved through careful analysis of the intensity values, size and form of each carbide in a four-step scheme, which is displayed in Fig. 2:
-
1.
Enhancing the lighting and contrast of each image to attain balanced illumination conditions in all regions.
-
2.
Selecting appropriate thresholds for the intensity value for each phase in every specimen.
-
3.
Morphologically opening the resulting images with a conveniently shaped structuring element.
-
4.
Applying a watershed transform to the B&W images.
The user can adjust certain variables in steps 2 and 3 of this scheme during runtime, meaning that if after step 3 the general results are not satisfactory, it is possible to modify certain parameters and return to step 2. Figure 2 and section 2.3.3 provide the required details for its implementation.
As previously discussed, the image batch is imported into the image processing software, where it is processed sequentially. This means that once the settings for the enhancement and binarization are set for one picture, all the other micrographs taken from the same sample are processed in the same way, one after the other.
If correctly implemented, this scheme also allows the division of a relatively large micrograph into smaller portions for better handling, as depicted in Fig. 3. By doing so, it is possible to adjust the variables of steps 2 and 3 in just a small part of the large image and see the changes in real time with virtually no waiting time. This can lead to an improvement in the user experience. This procedure is especially useful for users that wish to use this method in old or otherwise slow computers.
Lighting Enhancement
Firstly, lighting enhancing is performed by finding the spatial variation in the illumination in the grayscale images. Figure 4(a) shows a micrograph presenting a shadow axially extending from its right side and ending at around a third of the image.
The aforementioned variation in the illumination can be isolated, in our case, by filtering the image. One of the two filters is applied, following the next rule: the minimum filter when the background is darker than the carbides and the maximum filter when it is the other way around. Maximum and minimum filters attribute to each pixel in an image a new value equal to the maximum or minimum value in a neighborhood around that pixel, respectively.
In grayscale images, the morphological operators of dilation and erosion can perform the maximum and minimum filtering, respectively. The operations are defined on an image of intensities \(I\left( {x,y} \right)\), where x and y are the coordinates of each pixel. Dilation is denoted with the symbol \(\oplus\) and erosion with the symbol \({ \ominus }\), and are defined as (Ref 28):
$$\left( {I \oplus S_{el} } \right)\left( {x,y} \right) = \hbox{max} \left\{ {I\left[ {x - x^{{\prime }} , y - y^{{\prime }} } \right]:\left[ {x^{{\prime }} ,y^{{\prime }} } \right] \in S_{el} } \right\}$$
(3)
$$\left( {I{ \ominus }S_{el} } \right)\left( {x,y} \right) = \hbox{min} \left\{ {I\left[ {x - x^{{\prime }} , y - y^{{\prime }} } \right]:\left[ {x^{{\prime }} ,y^{{\prime }} } \right] \in S_{el} } \right\}$$
(4)
There, the neighborhood is described by the so-called structuring element \(S_{\text{el}}\), whose pixels have the coordinates denoted with \(x^{{\prime }}\) and \(y^{{\prime }}\).
Figure 4(b) exhibits the already filtered image, uncovering the variation in the illumination.
Then, the filtered image is subtracted from the original image. This technique is called image differencing and is the one enabling the removal of the unwanted illumination gradients. Finally the obtained image is scaled so that its maximum and minimum intensity values are the above-mentioned 65535 and 0, respectively.
Figure 4(c) displays the resulting micrograph. It is noteworthy that the structuring element must be chosen carefully to obtain best results: It should be bigger than the objects of interest and it should fit appropriately the orientation of the lighting imperfections.
Image Binarization
Secondly, the thresholds for each batch are computed semiautomatically, based on the multi-level (ML) thresholding algorithm proposed by Liao et al (Ref 29). This algorithm, like its most popular alternatives (Ref 30, 31), automatically computes the intensity value that divides the given image in the required amount of zones without overlapping, according to different criteria. This concept and its shortcomings are displayed in Fig. 5(a) and (b), where it is clearly seen that the phase recognition can be greatly improved:
-
(a)
The limit intensity for the MC (dark) phase is set too low, leaving some carbides semi-detected and some not even considered, meaning that some pixels are too clear for this algorithm to properly classify them.
-
(b)
In the M7C3 (bright) phase, the limit was set too high, leading to the same issues as in the MC phase, but in this case for the pixels that are too dark.
The method here proposed takes into account the maxima and minima intensity values of each phase to adjust the above-described thresholds, from here on represented as To.
The new upper and lower levels for each phase, Tu and Tl, respectively, are obtained based on the intensity values I(x, y) of N pixels selected by the user, given by the weighted mean:
$$T_{u;l} = \frac{{k_{1} \left( {\bar{I} \pm 2s_{I} } \right) + k_{2} T_{o} }}{{k_{1} + k_{2} }}$$
(5)
where \(\bar{I}\) is the mean of the intensity of the N selected pixels, \(s_{\text{I}}\) is the sample standard deviation and \(k_{1}\) and \(k_{2}\) are weights that have to be calibrated. This last equation is based on the assumption that the intensities for this kind of application are normally distributed (Ref 32), and therefore, 95% of the pixels corresponding to a phase will be considered in a two-sigma band. Figure 5(c) and (d) shows the result of admitting overlapping in the threshold values of the carbide phases.
Removal of Pixel Islands not Matching the Carbide Morphology
Thirdly, the images are morphologically opened. Opening of an image is closely related to erosion and dilation. These two morphological operators were opportunely described while discussing the lighting enhancement algorithm. The open operator is given by:
$${\text{open}}\left( I \right) = \left( {I{ \ominus }S_{\text{el}} } \right) \oplus S_{\text{el}}$$
(6)
The erosion operation removes the elements that are smaller than the structuring element, and dilation restores the remaining objects. For this operation to work properly, the structuring element should be selected carefully to match the shape and size of each carbide phase.
In case the results obtained after the steps executed so far are not good enough (i.e., the threshold overlapping or the carbide size do not coincide with the micrograph), the weights \(k_{1}\) and \(k_{2}\) and the structuring element of the morphological open \(S_{\text{el}}\) can be adjusted independently or together, as represented schematically in Fig. 2. This makes possible even further overlapping in the multi-level thresholding because the opening operation will remove the pixel islands not complying with the size and shape of the structuring element.
Subdivision of Pixel Islands Comprising Several Carbides
Finally, a watershed transform (Ref 28) is carried out to subdivide the pixel islands that are composed of more than one carbide. This technique considers an image as a topographic surface and floods this surface from local minima. An example of this interpretation is shown in Fig. 6. Boundaries between different regions are created when their floods meet.
The watershed transform has been successfully employed in the scientific literature to segment microstructures of several materials. Campbell et al. (Ref 33), for instance, used it to differentiate phases in titanium alloys. In order to apply this tool to this particular problem, it is first necessary to perform a distance transform (Ref 34, 35) to the complement of the binary image. This transformation assigns to each pixel of a carbide a number that is equal to its distance to the nearest pixel belonging to a different phase. This is particularly convenient because it creates basin-like shapes for the watershed flooding.
Figure 7 shows a selected region of a micrograph as the operations here described are executed. Figure 7(a) displays the chosen area in the micrograph, Fig. 7(b) features the binary version of the image, while Fig. 7(c) and (d) shows the effect of the distance and watershed transforms, respectively.
After the distance transform and before the watershed transform an h-minima transform might be necessary to avoid oversegmentation. This transformation suppresses all minima in the intensities I(x, y) according to a threshold value (Ref 36) that can be either determined manually or computed from the mean and standard deviation of I(x, y). It was found that for regular particle shapes this transform is not necessary, but might be useful if the microstructure presents a rather big particle shape dispersion.
Obtaining the Relevant Parameters of the Microstructure
Binary images ease the stereological analysis: Once the carbides are identified, the problem is reduced to measuring some quantities in the form of “pixel counting” and computing the others in a statistical way (Ref 17, 19). All the measurements and parameter calculations present in section 2.3.1 and 2.3.2 are to be performed individually for each carbide phase of the PM steel. Section 2.3.3 provides details about the characterization of alloys containing more than two phases.
Measurements
The quantities to be measured are five, namely:
-
(i)
The number of carbide clusters \(N_{p}\);
-
(ii)
The number of individual carbides \(N_{c}\);
-
(iii)
The number of pixels per individual carbide \(A_{c}^{i}\);
-
(iv)
The perimeter of each carbide cluster \(L_{P}^{j}\); and
-
(v)
The perimeter of each carbide \(L_{c}^{i}\).
The implementation of some of these measurements is straightforward: (i), (ii) and (iii) are easily performed with the help of any image analysis software capable counting the number of pixels that form each pixel island. This work scheme is an extension of work previously developed by some of the authors in (Ref 37), where binary characterization was successfully employed to create 2D finite element method models. Points (iv) and (v), on the other hand, are carried out with a somewhat more complex approach. Figure 8 displays in red a schematic representation of the magnitudes to be measured.
Even when the perimeter seems to be a familiar geometric measure, determining it in the context of binary images is far from trivial (Ref 38). The approach proposed in this work, as other published works (Ref 38,39,40,41), deals with the difficulties that arise when measuring perimeters in a digital image. The main issue is that the perimeter tends to be underestimated by the pixel counting approach, provided there is no noise present (Ref 38). Even the correction scheme used, for example, in MATLAB®, proposed by Vossepoel et al. (Ref 41), encounters some problems when the ratio perimeter to area of each of the pixel island increases. This behavior is shown in Fig. 9, where the circularity is plotted against the above-mentioned ratio as computed in MATLAB® version R2016a, for the MC carbide of Alloy #4 that will be discussed in section 5. The circularity is a shape parameter, and for the ith carbide, it is defined as (Ref 38):
$$f_{circ}^{i} = \frac{{\left( {L_{c}^{i} } \right)^{2} }}{{4\pi A_{c}^{i} }}$$
(7)
Circles have a circularity value of 1 and all other shapes take values greater than 1. This means that all carbides that are below the horizontal line in Fig. 9 have its perimeter underestimated.
Luckily, Lehmann and Legland described and implemented an approach that delivers very good results and does not depend on biased length measurement algorithms (Ref 42). Conversely, their proposal is based in the Crofton formula for the planar case, defined as:
$$P\left( X \right) = \pi \mathop \int \limits_{{{\mathcal{L}}^{2} }}^{ } \chi \left( {X \cap L} \right)dL$$
(8)
where P is the perimeter of the object of interest, \(X,{\mathcal{L}}^{2}\) is the set of all lines in the 2D space, \(\chi\) is the Euler-Poincaré characteristic, which is equal to half the number of intersections of the boundary of X with the line L.
Its application to binary images results the most convenient option because the Crofton formula can be easily discretized:
$$P\left( X \right) \simeq \pi \mathop \sum \limits_{k} \frac{{c_{k} }}{{\lambda_{k} }}\chi \left( {X \cap L_{k} } \right)$$
(9)
where \(c_{k}\) is the discretization weight associated with direction \(k\), \(\lambda_{k}\) is the density of discrete lines in the direction \(k\) and \(L_{k}\) is the set of all lines in direction \(k\). Lehman and Legland found that four directions delivered good results in their measurements of disks and ellipses of different sizes and orientations.
Therefore, the perimeters \(L_{P}^{j}\) and \(L_{c}^{i}\) of each carbide cluster and of each individual carbide, respectively, are computed through the correct implementation of Eq 9.
Parameter Calculation
Once obtained from the measurement stage, the raw information is then transformed to different equivalent diameters that will later give shape to different parameters related to relevant properties. A schematic view of the general implemented process is shown in Fig. 10.
The following quantities are to be computed for each phase:
-
(i)
Mean equivalent areal diameter:
$$d_{c} = \frac{sc}{{N_{c} }}\frac{2\sqrt \pi }{\pi }\mathop \sum \limits_{i = 1}^{{N_{c} }} \sqrt {A_{c}^{i} }$$
(10)
-
(ii)
Sample standard deviation of the equivalent areal diameter, \(s.\)
-
(iii)
Mean equivalent perimeter diameter for individual carbides:
$$d_{cl} = \frac{sc}{{N_{c} \pi }}\mathop \sum \limits_{i = 1}^{{N_{c} }} L_{c}^{i}$$
(11)
-
(iv)
Mean equivalent perimeter diameter for carbide clusters:
$$d_{pl} = \frac{sc}{{N_{p} \pi }}\mathop \sum \limits_{j = 1}^{{N_{p} }} L_{p}^{j}$$
(12)
These quantities are schematically presented in Fig. 8 in blue color. sc is the scale of the micrographs in unit length over pixel.
The above-computed quantities allow the calculation of the mean carbide size intercept for the given phase in the following compact way:
$$d = \frac{\pi }{4}QRd_{c}$$
(13)
where Q is a measure of the variation in the carbide size and R a measure of the carbide shape and are defined as:
$$Q = \frac{{N_{c} - 1}}{{N_{c} }}\left( {\frac{s}{{d_{c} }}} \right)^{2} + 1$$
(14)
$$R = \frac{{d_{c} }}{{d_{cl} }}$$
(15)
The contiguity is then, for the sake of convenience, redefined as:
$$C = 1 - \frac{{N_{p} d_{pl} }}{{N_{c} d_{cl} }}$$
(16)
The derivation of the equations leading to these parameters can be found in “Appendix” of this document.
The carbide volume fraction is simply calculated as:
$$V_{V} = \frac{1}{wh}\mathop \sum \limits_{i = 1}^{N} A_{c}^{i}$$
(17)
where w is the width and h is the height of the image in pixels.
Finally, the mean free path in the matrix, for a two-phase alloy, can be computed from the already known relation:
$$\frac{\lambda }{d} = \frac{1}{1 - C}\frac{{1 - V_{V} }}{{V_{V} }}$$
(18)
or, what is the same:
$$\frac{\lambda }{{d_{c} }} = \frac{\pi }{4}\frac{QR}{1 - C}\frac{{1 - V_{V} }}{{V_{V} }}$$
(19)
These parameters are presented in Fig. 8 in green.
Equations 13 and 19, being the main contributions of this article, are particularly relevant because they link explicitly the parameters \(\lambda\), d and \(V_{V}\) with quantitative descriptors of the microstructure 2D morphology.
Extension to Alloys Containing More than One Carbide
As presented in the introduction to this section, the already calculated parameters for each individual phase α can be used to determine the mean free path in the matrix in multi-carbide alloys.
The following notation will be used through this section: \(\left( *\right)_{\alpha }\) denotes that the quantity * refers to the carbide phase α and \(\left( *\right)_{t}\) denotes that * refers to the total for the given alloy.
The total amount of features of interest results from a simple summation over the m carbide phases:
$$N_{t} = \mathop \sum \limits_{\alpha = 1}^{m} \left( {N_{c} } \right)_{\alpha }$$
(20)
The mean equivalent areal diameter in the whole alloy is analogous to Eq 10:
$$\left( {d_{c} } \right)_{t} = \frac{sc}{{N_{t} }}\frac{2\sqrt \pi }{\pi }\mathop \sum \limits_{i = 1}^{{N_{t} }} \sqrt {\left( {A_{c}^{i} } \right)_{t} }$$
(21)
Consequently, the standard deviation \(\left( s \right)_{t}\) must be computed as well. This calculation is performed in the same fashion as pointed out in section 2.3.2. The mean equivalent perimeter diameter, due to the linear nature of perimeter calculation for circles, can be expressed as a weighted mean over the m equivalent diameters \(\left( {d_{cl} } \right)_{\alpha }\), as computed with Eq 11:
$$\left( {d_{cl} } \right)_{t} = \frac{1}{{N_{t} }}\mathop \sum \limits_{\alpha = 1}^{m} N_{\alpha } \left( {d_{cl} } \right)_{\alpha }$$
(22)
The quantity analogous to that presented in Eq 12 must be measured: \(\left( {d_{ql} } \right)_{t}\) is the mean equivalent perimeter diameter of the carbide clusters. Please note that these clusters might be composed of carbides of different phases.
$$\left( {d_{ql} } \right)_{t} = \frac{sc}{{\left( {N_{p} } \right)_{t} \pi }}\mathop \sum \limits_{j}^{{N_{q} }} \left( {L_{q}^{j} } \right)_{t}$$
(23)
where \(\left( {N_{p} } \right)_{t}\) is the number carbide clusters that, as mentioned in the previous paragraph, might be composed of carbides of different phases. This means that this magnitude cannot be computed in the same fashion as \(\left( {N_{p} } \right)_{t}\) in Eq 20, but it must in fact be measured from the micrographs. \(\left( {L_{q}^{j} } \right)_{t}\) is the perimeter of the jth carbide cluster.
Replacing these quantities in Eq 14, 15 and 16 and finally in 13 yields:
$$\left( Q \right)_{t} = \frac{{N_{t} - 1}}{{N_{t} }}\left( {\frac{{\left( s \right)_{t} }}{{\left( {d_{c} } \right)_{t} }}} \right)^{2} + 1$$
(24)
$$\left( R \right)_{t} = \frac{{\left( {d_{c} } \right)_{t} }}{{\left( {d_{cl} } \right)_{t} }}$$
(25)
$$\left( C \right)_{t} = 1 - \frac{{N_{q} \left( {d_{ql} } \right)_{t} }}{{N_{t} \left( {d_{cl} } \right)_{t} }}$$
(26)
$$\left( d \right)_{t} = \frac{\pi }{4}\left( Q \right)_{t} \left( R \right)_{t} \left( {d_{c} } \right)_{t}$$
(27)
The total carbide volume fraction is computed as:
$$\left( {V_{V} } \right)_{t} = \mathop \sum \limits_{\alpha = 1}^{m} \left( {V_{V} } \right)_{\alpha }$$
(28)
Finally, the mean free path in the matrix can be computed from either Eq 18 or 19.