Introduction

Wear is a general concept that comprises several forms of material loss as a result of relative motion between a surface and one or more substances. Abrasive wear in particular refers to wear due to hard particles or hard protuberances forced against and moving along a solid surface (Ref 1). Abrasive wear resistance is a property that depends on both the material microstructure and the abrasive system, together forming the tribosystem (Ref 2). This means that it is not possible to strive for the perfect wear-resistant material in all possible work environments: Each problem must be analyzed and solved independently. Usually, steels composed of hard phases (carbides in our case study) embedded in a softer, more ductile, metallic matrix are employed as wear-resistant materials because of their excellent mixture of mechanical properties. Figure 1 shows grooves on the matrix of a high-speed steel, product of scratch testing: It can be clearly seen that the carbides stop the abrasive particles from further penetrating the matrix. When this is the case, in practice, some general rules are applied to select the material that will display the best behavior in a given abrasive environment. Generally, these rules consider some of the following microstructural parameters:

Fig. 1
figure 1

Grooves on the matrix product of scratch testing on a high-speed steel

  1. (i)

    Mean carbide intercept size, denoted with the symbol d;

  2. (ii)

    Mean free path in the matrix, denoted with the symbol λ; and

  3. (iii)

    Volume fraction of the carbide phase, denoted with the symbol \(V_{V}\).

These parameters are then related to the abrasive particle or groove size Dg. For instance, the following inequality is, in general, a requirement in the field of alloy design for wear environment applications (Ref 3):

$$\lambda < D_{\text{g}} < d$$
(1)

Some authors, on the other hand, have dwelled on the influence of each of these factors in different wear settings. Zum Gahr et al. (Ref 4,5,6) proposed a new microstructural parameter that relates all these quantities in white cast irons. Doğan et al. (Ref 7) performed different abrasion tests and analyzed the microstructure of TiC MMCs, concluding that the mean free path in the matrix had the best correlation to volume loss throughout all the tests. Polak et al. (Ref 8) employed linear regression to detect which parameter has more influence in the abrasion behavior in Ni-based systems with WC carbides. Aiguo et al. (Ref 9) reported an increase in the abrasive wear resistance with a decrease in the mean free path in the matrix.

Stereology has been used to characterize a three-dimensional (3D) microstructure in terms, for example, of the above-described parameters for several years now, while only analyzing two-dimensional (2D) micrographs (Ref 10). The principle, however, remains the same nowadays, even with more powerful microscopes and computers available: The linear intercept (LI) method is still widely used to characterize microstructures (Ref 11,12,13,14,15,16). This method consists in drawing test lines over a micrograph and counting the amount of intercepts of the carbide-carbide and carbide-matrix interfaces as well as measuring the length of each newly defined segment throughout each line (Ref 17). In its modern version, however, these operations are performed by image analysis software over digital micrographs. These programs consider rows and/or columns of the digital image as the test lines and automatically measure all the required quantities.

Although this automatic method has become standard in the field of image analysis (Ref 8, 18), the information that can be extracted out of it is limited by its own nature: d and λ are linear density parameters. They are not, at least explicitly, giving away any details about the shape or distribution of the particles. Take, for example, two two-phase alloys with the same d value. One could mistakenly expect these two alloys to be equivalent to each other in terms of morphology or size distribution of its particles. However, in reality, the two alloys can contain carbides with completely different shapes and therefore completely different size distributions. This means that the mean carbide intercept size does not unequivocally determine the carbide form and/or its size dispersion. This can be easily seen in one of the most general stereology equations:

$$\frac{\lambda }{d} = \frac{{1 - V_{V} }}{{V_{V} }}$$
(2)

In other words, the quotient of the linear density of the two phases in a simple two-phase material is equal to the quotient of its volumetric density. The word explicitly was carefully placed in the previous paragraph to imply that, indeed, the information is implicitly yielded by these quantities: d is simultaneously a function of both the particle area (and therefore its dispersion) and their shape.

A more detailed approach is needed to properly address the following questions, particularly in an abrasive wear behavior setting:

  1. (i)

    How big is the carbide size dispersion?

  2. (ii)

    How regular is the shape of the carbides?

  3. (iii)

    How do these attributes affect the relevant wear resistance parameters?

With this shortage and a future computational application in mind, this proposal describes the aforementioned relation in terms of the carbide equivalent areal diameter (EAD) (which is a measure of the carbide size and is not biased by the shape of the feature) and some tailored parameters to properly describe every detail in any carbide phase. An alternative definition for carbide contiguity is also provided. The approach is based entirely on features that are measurable with any image analysis software such as areas and perimeters.

These features make this approach ideal to tackle material design problems such as designing artificial microstructures with equivalent features as real ones, in both 2D and 3D (Ref 19,20,21,22). In particular, the application in the field of PM steels is promising, where the manufacturing processes allow more control over microstructural parameters (Ref 23) and where the discussion about the relation between microstructure and abrasive wear behavior usually takes into account the carbide volume fraction or its size (Ref 24,25,26,27). This new approach is integral, in the sense that it relates the most important abrasion resistance parameters to the microstructure descriptive parameters that permit the reproducibility and comparability of the hard phases.

The general procedure is presented in section 2. Section 3 describes in more detail the parameters presented in this work. Section 4 discusses the implementation of the algorithms. Section 5 elaborates on the evaluation methods employed to test the accuracy and applicability of the proposal. The obtained results are evaluated in section 6, where, additionally, they are compared with the results attained with other methods available in the scientific literature. Finally, some concluding remarks are presented in section 7. In “Appendix” are detailed the main steps to prove the equations here presented.

Proposed Scheme for Obtaining Relevant Microstructural Parameters

Overview

The proposed scheme can be divided in four steps:

  1. 1.

    Obtaining an image (or series of images) of the desired steel in the mesoscopic level.

  2. 2.

    Converting the image (or series of images) into binary images.

  3. 3.

    Measuring the required quantities.

  4. 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:

Fig. 2
figure 2

Overview of the proposed workflow to obtain the segmented binary images

  1. 1.

    Enhancing the lighting and contrast of each image to attain balanced illumination conditions in all regions.

  2. 2.

    Selecting appropriate thresholds for the intensity value for each phase in every specimen.

  3. 3.

    Morphologically opening the resulting images with a conveniently shaped structuring element.

  4. 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.

Fig. 3
figure 3

75 × 75 μm2 micrograph divided into 16 smaller images. Each smaller portion can then be analyzed individually to attain better handling conditions in any computer

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.

Fig. 4
figure 4

Lighting enhancement procedure. (a) Original image with shadow axially extending from the right. (b) Uncovered variation in the illumination. (c) Resulting micrograph

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:

Fig. 5
figure 5

Histograms and phase recognition in a PM containing two carbide phases, MC (red) and M7C3 (green), in a martensitic matrix. (a) Histogram and threshold values as computed by the multi-level thresholding algorithm proposed by Liao et al.; the threshold values are not overlapped. (b) Resulting phase recognition given the histogram in (a). (c) Histogram and threshold values admitting overlapping. (d) Resulting phase recognition given in the histogram (c) (Color figure online)

  1. (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.

  2. (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(xy) 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.

Fig. 6
figure 6

Alloy #4 micrograph. (a) 2D representation and (b) topographic representation

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.

Fig. 7
figure 7

MC carbides in the selected area of a micrograph (a) original, (b) after processing and binarization, (c) after distance transform and (d) after watershed transform

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:

  1. (i)

    The number of carbide clusters \(N_{p}\);

  2. (ii)

    The number of individual carbides \(N_{c}\);

  3. (iii)

    The number of pixels per individual carbide \(A_{c}^{i}\);

  4. (iv)

    The perimeter of each carbide cluster \(L_{P}^{j}\); and

  5. (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.

Fig. 8
figure 8

Schematic representation of the magnitudes to measure in red, the target parameters in green and the intermediate magnitudes in blue (Color figure online)

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):

Fig. 9
figure 9

Circularity vs. ratio between perimeter and area for MC carbide in Alloy #4

$$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.

Fig. 10
figure 10

Parameter calculation scheme

The following quantities are to be computed for each phase:

  1. (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)
  2. (ii)

    Sample standard deviation of the equivalent areal diameter, \(s.\)

  3. (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)
  4. (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.

On the Value of the Parameters

The possible values all new parameters can take and their meaning are discussed in this section.

Distribution (Q)

The distribution parameter Q can take either the value \(Q = 1\) if all the carbides in the micrographs have the same area and \(Q > 1\) otherwise. Values of 1 are extremely rare because even if the alloy contains spherical carbides with only one diameter, the random nature of the planar sampling will create an area distribution.

Assuming that the features of interest (in our case carbides) are randomly distributed on the analyzed plane, i.e., the feature phase volume fraction is small, the number of features of a given area \(A_{c}^{i}\) will follow a Poisson distribution (Ref 43). Since this is the case for the materials analyzed in this work, a gamma distribution, \({\text{Gamma}}\left( {a,p} \right)\), is a good fit to the size distribution. Under this assumption, Eq 14 can be modified to accommodate its shape parameter a:

$$Q = \frac{{N_{c} - 1}}{{N_{c} }}\frac{1}{a} + 1$$
(29)

Assuming that the sample is big enough, then we can rewrite:

$$Q = \frac{1}{a} + 1$$
(30)

To incorporate the gamma distribution scale parameter p, Eq 13 can be updated, yielding:

$$d = \frac{\pi }{4}\left( {a + 1} \right)pR$$
(31)

Equation 31 is particularly interesting because it allows, under very simple assumptions, the creation of a grain size distribution out of well-known stereological parameters. This is useful, as stated in the introduction, for the materials design field.

Shape (R)

The shape parameter R also displays a boundary value: If the sample only contains perfect circles, \(R = 1\) and \(R < 1\) otherwise. It is closely related to the definition of the normalized circularity, as shown in Eq 7 and 15.

It is noteworthy that these two quantities are not, in most cases, equal to each other. R is a parameter defined over the complete sample, in the same fashion as, for example, the mean circularity. However, the mathematical definitions of these geometric parameters are far from equivalent.

Following a similar approach to the one presented in “Appendix” for the parameter Q, it can be proved that for big samples:

$$\overline{{f_{circ} }} = \frac{1}{{R^{2} {\mathcal{A}}^{2} N_{c}^{2} }}\left( {\hat{c}_{v} \left( {\sqrt {f_{circ} } } \right)^{2} + 1} \right)$$
(32.1)

with \({\mathcal{A}}\):

$${\mathcal{A}} = \frac{{\mathop \prod \nolimits_{i = 1}^{{N_{c} }} d_{c}^{i} \mathop \sum \nolimits_{i = 1}^{{N_{c} }} d_{cl}^{i} }}{{\mathop \sum \nolimits_{i = 1}^{{N_{c} }} \mathop \sum \nolimits_{j = 1}^{{N_{c} }} \left( {d_{c}^{i} d_{cl}^{j} \mathop \prod \nolimits_{{\begin{array}{*{20}c} {k = 1} \\ {k \ne i} \\ \end{array} }}^{{N_{c} }} d_{c}^{k} } \right)}}$$
(32.2)

where \(\overline{{f_{circ} }}\) is the mean circularity of the sample and \(\hat{c}_{v} \left( {\sqrt {f_{circ} } } \right)\) is the unbiased estimator of the coefficient of variation in the square root of the circularity. For the shape parameter \(R\) to be equivalent to the mean circularity \(\overline{{f_{circ} }}\), one condition must be met: The coefficient of variation \(\hat{c}_{v} \left( {\sqrt {f_{circ} } } \right)\) must be equal to zero. By meeting this condition, additionally, the coefficient \({\mathcal{A}}\) always takes the value \({\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {N_{c} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${N_{c} }$}}\).

Contiguity (C)

This quantity is completely equivalent to the contiguity obtained in the LI method (Ref 44, 45), but in this work it was reformulated it to reduce the total amount of measurements needed. It takes the value C = 0 when the carbides do not share any edges and has a theoretical maximum value of 1. This maximum value could only be reached if there was no matrix in the material, i.e., only hard phases were present in the micrographs.

Relation between the Intercept Size and the Mean EAD

Some authors already looked into the relation between these two measures of the carbide size (Ref 46,47,48,49). The most popular experimental relation is (Ref 50):

$$d \cong \sqrt {\frac{\pi }{4}} d_{c}$$
(33)

In this work, we proposed the relation described in Eq 13, where we defined d as a function of the area, its distribution and the shape of the particles. The degree of agreement between this experimental rule and the relation proposed in Eq 13 is analyzed later in this work.

Implementation

This section describes the implementation of the algorithms and procedures described in this work in MATLAB® R2016a. MATLAB® was chosen because its Image Processing Toolbox contains the main morphological operators and transformations applied in the binarization stage of the proposal and because it has an intuitive graphical user interface (GUI) builder (Ref 51).

Same results are expected if other non-proprietary software is employed. ImageJ, for instance, is an open-source program that has already many built-in useful functions. It is also extensible through plug-ins and macros, which would permit the implementation of the more complex perimeter measurements (Ref 52).

The authors published the function described in section 2.2.1 for illumination enhancement in the MATLAB® File Exchange (Ref 53). More details and examples of application can be found there.

In Eq 11, 12 and 23, perimeter measurements are required. These measurements were taken with the algorithm described in section 2.3.1. This function computes the perimeter of the pixel islands even if these islands lay on one of the edges of the image. It was therefore necessary to remove these pixels from the measurement to avoid overestimation of the boundaries. Its authors published the script in the MATLAB® File Exchange Web site, and the script is free to use (Ref 54). In the case that the analyzed images were the product of subdividing a larger micrograph, the objects lying in the borders of the smaller binary subimages can be reconstructed by, respectively, summing the corresponding perimeters and areas.

All these methods were coupled, together with the used standard MATLAB® functions such as watershed and distance transforms, through a GUI, as displayed in Fig. 11. Several buttons and sliders were included in order to make the processing of the image batches faster. Further details are not provided since this is beyond the scope of the current work. The main idea behind the creation of a GUI was to grant greater control of the underlying algorithms to the user. The two main reasons for this are: (i) This method is semiautomatic and therefore needs the user to identify some points of an image as belonging to each phase and (ii) in the event that the threshold computation was not good enough, the GUI allows the user to correct the degree of overlapping of the threshold immediately through modifications of k1 and k2 in Eq 5 and Sel in Eq 6.

Fig. 11
figure 11

Graphical user interface (GUI) specifically created to tackle these problems

Evaluation Methods

Before assessing the capabilities of the developed method in an experimental setting, tests on simple models were performed: The main stereological quantities were measured on various 2D shapes, whose true analytical value can be computed.

Firstly, a set of binary images containing constant volume fraction and uniform size distribution of disks were analyzed to examine the relation given in Eq 13. The images were directly created in MATLAB® with custom scripts, following the discretization method detailed in (Ref 42). In all cases, the image size was 1024 × 1024 pixels.

Secondly, binary images containing disks and ellipses with different volume fractions, and Q and R parameters were created employing a random sequential addition (RSA) algorithm, together with the already mentioned discretization method and Eq 31 and 32.1. Here, the image size was set to 814 × 814 pixels.

Finally, eight steels were chosen with different carbide compositions, volume fractions, morphologies and contrasts against the matrix when observed in SEM images. Table 1 shows the main features, steel type and chemical composition of each steel. All samples were manufactured through powder metallurgy via hot isostatic pressing (HIP) (employing a temperature of 1100°C and a pressure of 1000 bar) and subsequently oil-quenched from the respective austenitizing temperature of each steel. The specimens were then prepared by grinding with SiC paper (#1000) and then successive polishing steps. The final polishing was performed with a diamond suspension solution containing an average grain size of 0.04 µm. Figure 12 displays representative examples of all samples. Ten images with horizontal field of view of 27.6 µm and with vertical field of view of 20.7 µm (summing up to a total surveyed area of 5712 µm2) were taken on a TESCAN® MIRA3® SEM employing the backscatter electron detector for each sample. The image size in pixels was set in all cases to 1024 × 766 and the bit depth to 16. As a result, the pixel size both in x and y directions was 27 nm. Lighting was enhanced, when possible, with the software provided by the microscope’s vendor and, when necessary, with the developed algorithm. All images of each sample were loaded into the developed GUI to be sequentially processed and converted to B&W images. The described algorithms were employed, lastly, to perform the measurements and necessary parameter calculations. Parameters \(k_{1}\) and \(k_{2}\) in Eq 5 were set to 0.5 showing generally good results. The user occasionally adjusted these values, with the provided sliders, for the more complicated alloys, such as Alloy #1. The amount of points N was set to 10 in all cases.

Table 1 Analyzed alloys and their carbides
Fig. 12
figure 12

Micrographs taken from all the PM steels used in the experimental campaign. (a) Alloy #1; (b) Alloy #2; (c) Alloy #3; (d) Alloy #4; (e) Alloy #5; (f) Alloy #6; (g) Alloy #7; and (h) Alloy #8

To test the applicability of the proposed method in terms of it overall accuracy, the images resulting from all previously mentioned evaluation approaches were analyzed through the LI method. To accomplish this task, some additional MATLAB® scripts were written, following the description of the method outlined in section 1, and coupled to the existent GUI. Since the image sampling was already random, the test lines were considered in grid form, as shown in Fig. 13. To force good efficiency, the distance between test lines in all samples was set approximately to the carbide minimum diameter (Ref 55).

Fig. 13
figure 13

Micrograph displaying the different phases and the test lines drawn to compute the LI method

Results

Tests on Disks of Uniform Size Distribution

Figure 14 shows the results of the measurements of d and \(d_{c}\) on images containing disks of different diameters but constant volume fraction and uniform size distribution. Figure 14(a) displays four of the produced models, and Fig. 14(b) displays the measurements and the expected analytical values. These values are computed out of Eq 13 for parameters \(Q = R = 1,\) resulting in:

Fig. 14
figure 14

Tests performed on equally sized disks. (a) Images employed. All images have the same volume fraction of white pixels, but distributed in a different number of disks of the same size. (b) Comparison between analytical and measured values. Measurements employing our method and the LI method are reported

$$d = \frac{\pi }{4}d_{c}$$
(34)

As expected, the values obtained with the LI method are in agreement with the measurements. This information is also shown in Fig. 14(b).

Tests on Disks and Ellipses of Irregular Size Distribution

Figure 15 exhibits the outcome of the measurement of λ in images containing (i) disks of given size distribution and (ii) ellipses of uniform size distribution and given aspect ratio. Figure 15(a) and (b) shows two examples of the created binary images containing disks and ellipses, respectively. Figure 15(c), on the other hand, displays the comparison between the expected and measured values of λ as the volume fraction VV increases in both cases. The LI method was also successfully applied, showing very good agreement, as exposed in Fig. 15(c).

Fig. 15
figure 15

Test on disks and ellipses. (a) Example binary image containing disks with a given size distribution, keeping all other factors constant. (b) Example binary image containing ellipses of random orientation and constant size and aspect ratio. (c) Comparison between analytical and measured values. Measurements employing our method and the LI method are reported

Tests on Micrographs

The results of the tests on micrographs are given in Table 2 and Table 3. All MC hard phases have shown, as expected, similar values of the shape and size distribution parameters except for Alloy #8. This alloy, as shown in Fig. 12(d), actually exhibits greater deviation in the area of the carbides and also has more irregular shapes in comparison to, for example, Alloy #4. The other primary carbides (M6C or M7C3) are more irregular, as it can be quantitatively seen in the aforementioned tables. The phase that showed the most irregular shape is the M7C3 phase of Alloy #6, which is shown in Fig. 12(f). The combination of these two attributes is shown in Fig. 16, where the distribution parameter Q was plotted against the shape parameter R. MC carbides can be, in general, found on the left upper part of the diagram, while the other primary carbides tend to be in the right lower part.

Table 2 Results of the stereological analysis for single phases of the selected samples
Table 3 Results of the stereological analysis for the total carbide fraction of the selected samples
Fig. 16
figure 16

Distribution parameter Q vs. shape parameter R for all the hard phases present in the analyzed samples

The fact that the intercept size d does not explicitly provide information about the morphology of the phase can be seen, for instance, when comparing the rather regular M6C phase in Alloy #1 with the M7C3 phase in Alloy #6: Both have approximately the same intercept size but do not share morphological traits.

Figure 17 shows that the general relation between the size parameters, d and dc, and \(\lambda\) and Vv in both cases follows a multiplicative inverse function defined by, for example, Eq 2. This means that even though the relation between d and dc is neither constant nor independent of the structure as demonstrated above, Eq 19 behaves in the same way as the basic Eq 2, i.e., the main contribution to the variation in d is the variation in dc. The reason for this is that both Q and R are bounded parameters that vary in opposite directions of the real numbers line, rendering them less relevant to the overall nature of the aforementioned relation.

Fig. 17
figure 17

Surface plot fit of the free path in the matrix as a function of the vol. content and (a) the EAD and (b) the intercept size for each of the hard phases

Relation between the Intercept Size and the Mean EAD

As described in section 3.4, an experimental relation between these two quantities has already been detailed in the scientific literature. As per Eq 13, the product of the parameters Q and R is presented for each of the carbide phases in Table 4. The difference measure diff is given by:

Table 4 Comparison between the values relating the mean intercept size and the mean EAD
$${\text{diff}} = 100\left( {\frac{QR}{{\sqrt {\frac{4}{\pi }} }} - 1} \right)$$
(35)

Equation 33 overestimates the value of the intercept size for this kind of steel. It showed more precision when the value of the parameters Q and R were higher, meaning more size dispersion and rounder planar intercepts of the carbides, respectively.

Comparison with the Linear Intercept Method

The results of this comparison for each of the single carbide phases are given in Table 5, where the measure of the relative error is given as:

$$e = 100\left( {\frac{*}{{*_{LI} }} - 1} \right)$$
(36)
Table 5 Results of the comparison between the method presented in this work and the linear intercept method

There, * represents either the intercept size d or the mean free path in the matrix \(\lambda\) and \(*_{LI}\) represents a quantity measured with the LI method.

In all the cases, the results are very good, yielding a relative error between methods of less than 1% for all carbides in all alloys.

Concluding Remarks

A new method to characterize microstructures based on their shape, size and its distribution and contiguity was developed and successfully implemented in the commercial software MATLAB®.

A series of final remarks can be drawn out of the scheme and proposed applications:

  • A new multi-level, sequential, semiautomatic and adjustable thresholding scheme was implemented through a GUI in MATLAB® easing the task of binarizing the required micrographs.

  • Two ad hoc parameters were mathematically defined and implemented to quantitatively describe important carbide phase features: size distribution and shape. The contiguity was mathematically redefined to minimize the number of required operations.

  • These parameters were compared with similar descriptors found in the scientific literature to highlight their main differences and application prospects.

  • The method was tested on models of known geometry and on different PM steels and compared with the LI method, showing good agreement.

  • The relation between the mean equivalent areal diameter and the carbide intercept size was explicitly derived as a function of the size distribution and shape of the carbide phases.

  • The possibility of creating artificial microstructures with given target parameters and size distribution was detailed. Examples of application can be found in this work as well, since the models designed as test scenarios were created with very simple assumptions and algorithms, based on the equations here described.

The proposed procedure is a very useful tool in various levels. The novel approach to binarization, for example, can be independently employed to tackle other complex applications in the image processing field. The most promising field of application is material characterization and design, with the aim set on improving abrasive wear resistance, based on the newly defined parameters and their implications in the already known intercept size and free path in the matrix. For instance, in a recent work by Bostanabad et al. (Ref 22), where the state-of-the-art techniques in microstructure characterization and reconstruction are detailed, it can be seen how the physical descriptors here described fit the needs of a regular 2D/3D reconstruction scheme. Further developments in the creation of these microstructures are ongoing both in 2D and in 3D.

Additionally, the comparison and supplementing of the proposed method through optical microscopy, EBSD orientation mappings and EDX analysis are being under study for inclusion in upcoming works.

Finally, from a processing point of view, it would be interesting to perform calculations on micrographs of the same steels made via PM HIP and conventional ingot casting. Comparing PM HIP to conventional ingot cast tool steels shows that in the case of PM, more uniform microstructures and smaller average carbide size are obtained. This, together with extensive micromachining testing of the carbide-matrix and carbide-carbide interfaces in tool steels, poses the main challenges of our future research.