Use of a gray level co-occurrence matrix to characterize duplex stainless steel phases microstructure

Duplex stainless steels are widely used in industry. This is due to their higher strength compared to austenitic steels and to their higher toughness than ferritic steels. They also have good weldability and high resistance to stress corrosion cracking. These steels are characterized by two-phase microstructures composed by almost the same level of ferrite and austenite. Duplex steel 2205 samples evaluated are: as received, cold rolled (33%) and heat-treated at 800°C for 10 hours. A metallographic etching with 10% oxalic acid has been carried out to highlight the phases morphology. Some photos have been taken by SEM microscope and submitted to image analysis. The analysis carried out is based on the determination of co-occurrence matrix and on the following interpretation of appropriate indicators. Through these indicators is possible to estimate the features of images objectively.


INTRODUCTION
uplex stainless steels are resistant to intergranular corrosion [1].They are characterized by almost the same amount of two phases, ferrite and austenite.In the pseudo binary phase diagram of DSS, we can see after a first phase of fully ferritic solidification, there is a partial conversion of the microstructure in austenitic phase [2].In this paper a non invasive methodology is used to highlight the DSS microstructure, an algorithm based on a statistical approach, which allowed an objective and repeatable study of some images obtained by electron microscope.The statistical approach for image analysis based on the matrix of co-occurrence (GLCM Gray Level Co-occurrence Matrix) is widespread in many fields, alone or synergistically with other analysis, to evaluate the images morphology.This one, better known as "texture" (an innate property of all the virtual surfaces), gives information on the disposition of the structures and their relations with the environment.Relevant indicators will be derived from the GLCM to describe the "texture" of the image.Through this method it's possible to see tool marks, the presence of surface defects and also the grain boundaries of each phase.

D ANALYSIS METHOD
he spatial relationship of gray levels is expressed by the co-occurrence matrix suggested by Haralick [3,4] in the 70's.GLCM method assumes that the information on the texture image is adequately provided by a particular matrix.The technique is based on the manipulation of the gray levels of an image.If we consider a digital color image (Fig. 1) the first step is to convert it in gray tones (Fig. 2) using any image viewer.Digital images are made up of pixels that are stored in memory using 8 bit because it is assumed that 2 8 = 256 gray levels are sufficient to describe the nuances noticeable to the human eye.The gray levels are distinguished with numbers ranging from 0 (black) to 255 (white).Each gray level is stored as a binary number or as a sequence of bits.Each number corresponds to different gray level or different shades of gray level.
A particular shade of gray is then associated to each pixel component.The transformation in 256 gray levels is common with any Image Analysis program.Number of gray levels is an important factor in GLCM computation.More levels would mean more accurate textural information, but also an increase in computational costs.
A procedure of segmentation reduces the shades of gray.The pictures below show the difference between an image in 64 shades of gray (Fig. 3) and one in 8 (Fig. 4): In this article has been implemented a Matlab® program that carried out the conversion of the used images in shades of gray, and subsequently reduced the levels of them.
In particular we will compare a performance at 8 and 64 levels of gray.
The goal is to be able to recognize the "objects" that make up the image, i.e. phases, grain boundaries, inclusions, defects, etc.
Below the construction of the GLCM [5] matrix is shown with a simple example.

T
The GLCM is a square matrix whose size is equal to the number of gray levels which the starting image has been reduced in.
Consider a gray tones image, let us take a small part, for example 4x4 pixels.As already mentioned, each pixel has a gray tone (Fig. 5).In Fig. 6 there is the corresponding matrix of image, where shades of gray have been replaced by the corresponding number on the grayscale.GLCM of an image is computed using a displacement vector d, defined by its radius δ and orientation θ [3].
The technique works by forming a "detection window" on the image that scrolls over it.The window size and directions will vary depending on the problem at hand.The choice of δ often is in the range of values 1 and 2. Indeed, it is easy to see that the probability that two pixels have the same gray level is greater the more they are close.Small values of δ are used to better analyze fine textures, grain boundaries, the presence of carbides or nitrides, the remains of alumina powder used for polishing the specimen that has been not completely removed.
In the example δ=1 and θ=0° are chosen.Then the way is from left to right in horizontal with one pixel at one time.Three parameters will be considered to describe an image through GLCM: the number of gray levels, the orientation angle and the length of displacement.These parameters can be changed to improve the characterization.The algorithm will start in the top left corner and count the occurrences of each reference pixel to neighbour pixel relationship.Thus, each element (i, j) of GLCM is the sum of the number of times that pixel value i was located some distance δ and angle θ from pixel intensity j.
At the end of the process, the element (i, j) represents how many times the gray levels i and j appears as a sequence of two pixels located at a defined distance δ along a chosen direction θ.GCLM can be defined as: "a two dimensional histogram of gray levels for a pair of pixels, which are separated by a fixed spatial relationship."From the image above (Fig. 6) it's obtained the following GLCM, Fig. 7.The next step to determine the texture features is to express GLCM's terms as probabilities [6]; in order to achieve that goal selected statistics are applied by iterating through the matrix.The probability describes how often one gray tone will appear in a specified spatial relationship to another gray tone on the image.So the terms are divided in all possible combinations within the matrix of image along the selected direction.Then it's considered the normalization equation whose formula follows: where C(i, j) the value in cell (i, j), P(i, j) the probability, N the number of rows and columns.The final configuration of the co-occurrence matrix by 4 grey levels is shown in fig.8.The properties of an image texture are detected indirectly by using the co-occurrence matrix from which special indexes called "image indicators" are explotated.The gray level co-occurrence matrix (GLCM [7]) is just the tool to start and then get the 14 indicators defined in the Haralick's theory.The indicators calculated in this work are: (by convention if P(i, j)=0 then log P(i, j)=0) The Entropy indicator measures the disorder or complexity of an image.The highest value of Entropy is found when the values of P(i, j) are allocated quite uniformly throughout the matrix.This happens when the image has no pairs of grey level, with particular preference over others.Entropy is strongly but inversely correlated to Energy.
This statistic measures, the textural uniformity, it detects disorders in textures.This parameter indicates how much the texture is homogeneous, i.e. the GLCM contains values distributed fairly uniformly over all grid.It is high when the GLCM has few entries of large magnitude, low when all entries are almost equal.This is a measure of local homogeneity.

Contrast or inertia=
This statistic measures the difference between the highest and the lowest values of a contiguous set of pixels.It measures the amount of local variations present in the image.A low value of Contrast is obtained when the image has almost constant gray levels, vice versa this indicator presents high values for images.

Mutual information=
This indicator supplies further information by which the uncertainty about one variable is reduced by the given knowledge of the second variable.

APPLICATION
he duplex steel images examined have been obtained by the electron microscope.Three samples of 2205 duplex steel were evaluated, one as received, one cold rolled (33%), and one heat-treated at 800°C for 10 hours.

T
To highlight the amount and morphology of the phases, an electrolytic etching in 10% acid oxalic solution was carried out.The image analysis was performed by defining a detection window smaller (5×6 pixels) than the original (1000×1200 pixels).The parameters were calculated in detection windows arranged so as to cover the entire image, equally spaced in both horizontal and vertical directions.For each position of the detection window the co-occurrence matrix was calculated for the image reduced to 64 and to 8 gray levels.In this way it can be observed how much important is the choice of the gray levels number.

RESULTS
Matlab® program has been developed to calculate the co-occurrence matrix and the indicators.The image below (Fig. 9 )shows an example of the output).Figure 13: Energy 64 gray levels.

Figure 7 :
Figure 7: Initial configuration of the GLCM Figure 8: Final configuration for the GLCM Once the window of comparison ends scanning the image, the statistical measures begin to extract the characteristics of the matrix.

Figure 9 :
Figure 9: Energy indicator (8 gray tones) trend for the duplex as received.Numerical values of the indicators are explicited in this way by the software.With an appropriate rotation of axes we get the mapping (Fig.10) of each indicator.

Figure 10 :
Figure 10: Energy indicator map.The results provided by the chosen indicators show a good ability to describe the duplex steel "texture", showing in this case the grain boundaries, geminates and any impurities present in the sample.The following images are obtained with the used algorithm.

A
The tables below the group of pictures show the minimum and maximum values obtained for each indicator with 8 to 64 shades of gray.

Table 1 :
Minimum and maximum values assumed by the indicators.

Table 2 :
Minimum and maximum values assumed by the indicators.

Table 3 :
Minimum and maximum values assumed by the indicators