1 Introduction

Nodular cast irons are being used more frequently in highly stressed components, particularly in the automotive industry [4, 33]. Therefore, it is essential to thoroughly understand the factors influencing the fatigue properties of these materials [22, 46]. In spheroidal graphite cast irons, two types of defects may act as preferential sites for fatigue crack initiation and growth [39]. Graphite nodules with diameter around \(420~\upmu \)m are one of these sites [7].

Quantitative microstructure analyses are central to materials engineering and design [11, 13, 16, 36]. Traditionally, this entails careful measurements of volume fractions, size distributions, and shape descriptors of familiar microstructural features such as grains and second-phase particles [8, 17, 27]. These quantities are connected to theoretical and/or empirical models for material properties, e.g., grain boundary or particle-strengthening mechanisms [25, 26, 28].

Their fatigue strength depends on the structure of the matrix and the characteristics of the spheroidal graphite and casting defects [2]. In many cases, fatigue fracture is caused by casting defects; however, their fatigue strength can be improved by decreasing the number of casting defects that exist near the surface [12, 18, 29, 37].

There is a lot of work in the literature on gray and austempered ductile irons but little work on nodular cast iron with a ferritic matrix [3, 23, 24, 45].

The initial microstructure of nodular cast irons consists of graphite nodules surrounded by ferrite and some perlite. The average microhardness of the unprocessed material is approximately 150 HV [5]. A fully ferrite matrix is as cast without any heat treatment [10]. The volume fraction of nodules is \(10\%\) with a mean size of \(15~\upmu \)m and a ferrite grain size of \(50~\upmu \)m [6, 35].

The main contribution of this work is the correlation observed between the degenerated graphite and the mechanical properties of nodular cast iron. Also, an important contribution was the development of a computer vision algorithm capable of quantifying the degenerated nodules present in sample images of the spheroidal graphite cast iron. This algorithm helped understand the correlation between the degree of spheroidization and the respective mechanical responses of the analyzed material. The presented methods use mainly classification approaches to quantify microstructure characterization; therefore, they need a training phase, which tends to be a long process and in need of large amounts of data to achieve acceptable results [44]. This paper, however, proposes a simpler approach to this problem, relying mainly on image processing techniques to mimic human inspection. Not only that, but studies to determine the relationship between the degenerate nodules to the degradation of the mechanical properties of the material, namely, tensile strength in nodular cast iron, were not found in the literature.

This paper is organized as follows: Sect. 2 presents related works and explains the approach of each work. Section 3.1 presents the mechanical tests performed in this work. Section 3.2 presents the techniques used in the CV algorithm, showing the steps and explaining the method. Section 4 presents the results after applying the CV algorithm to the images and the correlation with the data generated by the mechanical tests. Finally, Sect. 5 presents the conclusion of this work and the results.

2 Related works

Papa et al. [40] reported that the automatic characterization of particles in metallographic images has been paramount, mainly because of the importance of quantifying such microstructures in order to assess the mechanical properties of materials commonly used in industry [14, 20]. These authors use machine learning classification techniques to do this, specially support vector machine, Bayesian, and optimum-path forest-based classifiers, as well as Otsu’s method, which is commonly used in computer imaging to automatically binarize images. Otsu’s method was also used in this work, where it demonstrated the need for more complex methods in the evaluation of characterization of graphite particles in metallographic images [41]. The optimum-path forest-based classifier demonstrated an overall superior performance, both in terms of accuracy and speed.

de Albuquerque et al. [11] presented a similar work, in which they compare two classifiers with different approaches for the task of microstructure segmentation. The first was an MLP (multilayer perceptron), a class of neural network supervised with backpropagation as the training method, and the second classifier was self-organizing map (SOM), which is an unsupervised machine learning algorithm that was proposed by Kohonen. The results showed the MLP performed similarly to human inspection.

de Albuquerque et al. [15] also presented a different system called SVRNA (segmentation by artificial neural network) for a study in the field of quantitative metallography applied to materials science. This system is used to characterize volumetric fractions of phases and grain size, as well as to determine inclusion distributions, among other parameters that influence the properties of materials, like nodular cast irons. This system is composed of a neural network with 42 neurons distributed in three layers. The neuron distribution corresponds to: 3 inputs, 30 neurons in the intermediate layer, and 9 neurons in the output layer. The inputs of the neural network are the R, G, and B components of each pixel. The output of the network, in turn, is the indication of which region, i.e., which color, should be assigned to the pixel under analysis.

The method mainly uses classification approaches to quantify the microstructure characterization; therefore, a training phase is needed, which tends to be a long process and requires large amounts of data to achieve acceptable results. In this work, we propose a simpler approach to this problem, and it relies mainly on image processing techniques to mimic human inspection. Studies to determine the relationship between the degenerated nodules and the reduction in the mechanical properties of the material, namely tensile strength in nodular cast iron, were not found in the literature.

3 Materials and methods

Figure 1 illustrates the purpose of this article. In summary, two samples are subjected to metallographic, microhardness, and traction test. Subsequently, the metallographic images are processed with CV techniques. The resulting image is then analyzed and relationships between the characteristics of the image and the mechanical properties of the material can be established.

Fig. 1
figure 1

Graphical abstract of the methodology

3.1 Mechanical tests

The identification and validation of mechanical models used to predict the behavior of materials and structures are still the central focus of experimental mechanics. The ever-increasing sophistication of these mechanical models and the multiplicity of the scales required to assess and quantify the microscopic phenomena at play also present challenging demands to mechanical tests [19, 31].

In this work, two samples of nodular cast iron from different manufacturers were used. The samples were cylindrical with diameters of 44 mm and 28 mm as shown in Fig. 2.

Fig. 2
figure 2

Samples of nodular cast iron. Sample “A” above and “B” below

The approximate chemical composition of nodular cast iron is: carbon (2 to 4%), manganese (0.3 to 1%), silicon (1 to 3%), phosphorus (0.1 to 1%), sulfur (0.05 to 0.25%), and iron [6, 21].

3.1.1 Metallography

The samples for the metallography assays were cut in the alternative saw into 15 mm length.

After cutting metallographic preparation was performed, sanding steps (up to 1200 mesh porosity), alumina and then etched with Nital 2% solution for 5 s to reveal the microstructure. Optical microscopy was performed on an Olympus GX51 microscope with Analysis Olympus software. The micrographs (Fig. 3) that could be seen under the microscope were captured by a computer connected to the microscope. All images were captured with a 200\(\times \) zoom. These images were used to develop the CV software, which is explained in more detail in a later topic.

Fig. 3
figure 3

Micrographs a sample “A”, b sample “B”

This process was carried out several times for both samples. The 44-mm-diameter sample was called “A” (Figure 3.1.1), and the 28-mm-diameter sample “B” (Figure 3.1.1). About 40 images for each sample were captured, to represent the surface for analysis as accurately as possible.

3.1.2 Traction tests

The traction test was carried out after the test bodies (Fig. 4) “A” and “B” had been prepared.

Fig. 4
figure 4

Test body used in the traction test. Sample “B”

The equipment used for the test (WAW300C—Time Group), consists of two heads, one upper (fixed) and one lower (mobile). In each head, there is a claw that holds the test body. At the start of the test, the lower head descends slowly, executing the pulling force. The equipment is connected to a computer that has process monitoring software, where it is possible to select the elongation value and then the machine applies the force corresponding to this elongation. The elongation selected in the test was \(0.5+15\%~\)mm/min.

Knowing that cast irons are generally fragile, the test body practically did not undergo any narrowing.

During the test, the software shows a tension \(\times \) time graph in real time, which characterizes the time required to reach the limit of traction resistance (LRT) that is shown at the end of the test. Figure 5 shows the samples fractured after the test.

Fig. 5
figure 5

Samples fractured after traction tests

3.1.3 Vickers microhardness tests

The microhardness values were acquired using Vickers hardness test very similar to a conventional hardness test, but with a much smaller diamond: only 7 mm long. The equipment used was a Vickers Insizer Ish—TDV1000-B. The diamond makes a microscopic perforation by applying a ranging from 0.1 to 1 kg f. The test body used is the same as the one used for the metallography test, since it already has a polished surface [42]. After drilling, the selected diamond diagonals are used to compute the resulting hardness. The load used was 0.5 kg f per 10 s. No norm was found regarding time and the load applied; therefore, these values were chosen because they are used generically for a large majority of materials; however, the choice of the values here was for comparison purposes only.

3.2 Computer vision algorithm

According to Fig. 6, the first step in developing the algorithm is to apply a median filter to remove any noise from the image. The best-known order statistics filter is the median filter, which replaces the value of a pixel by the median of the gray levels in the neighborhood of that pixel. The original value of the pixel is included in the computation of the median. Median filters are commonly used because they have excellent noise reduction capabilities for certain types of random noise, with considerably less blurring than linear smoothing filters of a similar size [30].

Fig. 6
figure 6

Algorithm flowchart

Subsequently, an Otsu threshold is applied, a nonparametric and unsupervised method of automatic threshold selection for picture segmentation. An optimal threshold is selected by the discriminant criterion, in order to maximize the separability of the resultant classes in gray levels. The procedure is very simple, using only the zeroth- and the first-order cumulative moments of the gray-level histogram [38]. Following this procedure, the nodules are in black and the ferritic matrix is in white, and therefore it is easier to distinguish the nodules from all other microstructures.

Then, a segmentation algorithm is applied. Region growing is a segmentation technique considered to be robust, fast, and free of tuning parameters. The method, however, requires the input of a number of seeds, either individual pixels or regions, which will control the formation of regions into which the image will be segmented [1]. This technique is able to group pixels from a pixel seed, with a previously specified stopping criterion. This technique was implemented by the Blob library wrapper around OpenCV (open-source computer vision) and a popular CV library [48], which is also able to store in simple data structures information about the nodules, in order to facilitate the extraction and calculation of points of interest of each node, e.g., coordinates of the edge and coordinates of the center of the nodules.

In order to differentiate the degenerated nodules from the normal ones, the concave and convex areas of the nodules were computed. The concave area (Fig. 7b) is the area of the nodule itself, and the area the convex nodule is the area that its surface occupies, as shown in Fig. 7a.

Fig. 7
figure 7

Convex area representation, a convex area, b concave area

Using these two areas, the concave area was divided by the convex, generating a value that ranges from 0 to 1. The concave area can never be larger than the convex area, so that this value is close to 1 when the nodule is normal because it approaches a sphere and when the nodule is degenerated, the value is less than 1. A threshold value of 0.4 was empirically chosen to better represent degenerated nodules, in such a way that the nodules with this a ratio value less than 0.4 would be considered degenerated.

4 Results

The sample test bars were initially cast, and at the end of the bar a completely homogeneous structure was expected. To demonstrate this, three traction tests were performed on the test bodies extracted from each bar; thus, similar results would indicate that the bar is in fact homogeneous. The following graphs (Fig. 8) present the results of the traction tests.

Fig. 8
figure 8

Micrograph results. a Tension \(\times \) displacement “A1”. b Tension \(\times \) displacement “B1”. c Strength \(\times \) displacement “A1”. d Strength \(\times \) displacement “B1”. e Strength \(\times \) displacement “A2”. f Strength \(\times \) displacement “B2”. g Strength \(\times \) displacement “A3”. h Strength \(\times \) displacement “B3”

The results show that the three test bodies of sample “A” fractured with a force of 58 kN and the three test bodies of sample “B” fractured at 62 kN.

The ReL point represents the stress at the flow limit, and the FeL point represents the strength at the flow limit. These points show the transition moment from the elastic deformation to the plastic deformation. On the other hand, the Rm point represents the tensile strength limit voltage and the Fm point represents the maximum strength. These points show the moment where the fracture occurs in the test body.

Table 1 shows the approximate values of Fm for all three tests and their algebraic average.

Table 1 Maximum approximate strength applied in the three traction tests

Table 2 shows the results of the Vickers microhardness tests of the samples “A” and “B”.

Table 2 Values of Vickers microhardness tests

The CV algorithm verifies which nodules have the concave/convex area ratio of each nodule less than 0.4; these are then considered to be considered a degenerated nodules, and the algorithm marks the degenerated nodules in red and the normal ones, in green, to facilitate counting. Figure 9 shows the results of this step.

Fig. 9
figure 9

Example of sample image segmentation

Table 3 Result of image segmentation software counts

The following measurements were made to compute the quantity of degenerated nodules: the average nodules per image, the average degenerated nodules per image, the average normal nodules per image, and the percentage of degenerated nodules in a total of 40 images. Table 3 shows the results of the CV algorithm.

The percentage of degenerated nodules presented in Table 3 is the most expressive value, but also, another variable must be considered, which is the nodule size, as shown in Fig. 9, where the “A” nodules are bigger than those of “B” and can be represented by amount of red pixels given in Table 3.

The nodules were quantified according to the Brazilian Association of Technical Standards (ABNT) MB01512. Nodules far from the edges of the image are counted as whole nodules and with at least one pixel touching the edge of the image are counted as half nodules and therefore are weighted by a factor 0.5 for the total sum of nodules.

5 Conclusions

This work proposes a computer vision (CV) algorithm to estimate the amount of degenerated graphite nodules as well as the image analysis necessary to determine the relationship between this quantity and the loss of the mechanical properties of nodular cast iron.

The difference between the hardness averages of samples “A” and “B” is only \(6\%\). Since the values are very close, it is known that the amount of degenerated nodules does not change the hardness of the material abruptly.

Furthermore, the results showed that the number of degenerated nodules is inversely proportional to the limit of traction resistance, since the sample “A” has a greater number of degenerated nodules than sample “B” and a lower limit of traction resistance, i.e., it breaks with less force.

In a future work, a larger number of test samples as well as more images will be investigated to help solidify the conclusions of this work. An online system for characterizing metal microstructures will also be developed [9, 32, 34, 43, 47].