#### 3.1. Algorithm

Fracture of the titanium alloy was considered as a localized deformation process. At the same time, features of its kinetics were reflected on the newly formed surfaces. Consequently, the fracture surface is a complete reflection of the boundary condition of the material, and the peculiarities of its morphology are manifestations of the deformation processes in the material.

In our case, the initial image for the proposed algorithm is a grayscale image of the fracture surface of titanium alloys VT23 and VT23M that was obtained using the scanning electron microscope REM 106-I (JSC “Selmi”, Sumy, Ukraine) (

Figure 1a,d). The algorithm contains two parts—basic and analytical. The basic part of the algorithm is used to identify areas of the image that belong to dimples of tearing. The analytical part of the algorithm is designed to calculate the quantitative parameters of the found dimples of tearing.

The fractographic image of the tearing surface of the specimen (

Figure 1a–d) can be considered as a surface described by the image intensity distribution function

${i}_{o}\left(x,y\right)$, where

$x=\overline{1,{i}_{w}},y=\overline{1,{i}_{h}}$, and

${i}_{w},{i}_{h}$ are the width and height of the image, respectively. For an 8-bit grayscale image,

${i}_{o}\left(x,y\right)\in \left[0\dots 255\right]$. Topologically, on the surface described by function

${i}_{o}\left(x,y\right)$, dimples of ductile tearing correspond to “valleys” of the pixel intensity, and the edges of dimples correspond to the “ridges” surrounding them.

A method based on the detection of dimple edges was used to highlight dimples of ductile tearing on the image. For this purpose, intensity differences were calculated for different parts of the image.

Initially, in order to eliminate the ejections of function

${i}_{o}\left(x,y\right)$, it was smoothed by applying the Gaussian filter:

where

$\Gamma $ is the Gaussian operator defined in the neighbourhood of point

$\left(x,y\right)$.

This allows for averaging the intensity of the pixel based on the surrounding area, while giving advantage to the existing value of intensity. Further actions were performed on the filtered image represented by the function $i\left(x,y\right)$.

Horizontal and vertical gradients of the function

$i\left(x,y\right)$ are:

Low values of the gradient correspond to the ridges and valleys of the function

$i\left(x,y\right)$. To highlight the ridges, the derivatives of the horizontal and vertical gradients were used:

To evaluate the second derivative at the point

$i\left(x,y\right)$, the Laplace operator was used [

20]:

Thus, the edges of dimples (maximums of the function

$i\left(x,y\right)$) correspond to minimums of

L. To improve the detection of ridges of the function

$i\left(x,y\right)$ and to reduce the effect that is caused by local features of the image, partial derivatives (3) were calculated based on pixels with a size

$\left(2k+1\right)\times \left(2k+1\right)$ from a certain neighbourhood. Also, in order to reduce the computational cost, division by the distance between pixels was removed from the calculation of partial derivatives:

In practice, the ridges of the function

$i\left(x,y\right)$ were found from expressions (6) by means of convolution the initial image with filters whose kernels are shown in

Figure 2a. It is established experimentally that in the case of the investigated images, a good result was obtained from filters with

k = 3. Given this, the white sections of the filter have coefficients of 6 and the black ones have coefficients of 1. In the general case, the coefficient of the white band is 2

k. As a result of the described transformations, we obtain an image that is described by the following function:

Thresholding of image

${i}_{L}$ and skeletonization of the obtained network of edges were performed prior to the segmentation of the edges of dimples. Skeletal image

${i}_{s}$ was obtained by multi-path overlay of templates on the resulting binary image (

Figure 2b) [

20]. The central black pixel was removed from each area corresponding to one of the templates. Since the edges of dimples should be interconnected, the “hanging” fragments of the skeleton were also removed.

Figure 3 shows the initial images (

Figure 1) with the well-defined edges of dimples attached to them. As a result of skeletonization, we obtain a set of points that describe the distribution lines between dimples. To expand this boundary, a morphological transformation of dilation with a structural element of 3 × 3 pixels was used to the skeleton.

After that, the connected areas of pixels surrounded by previously found edges were selected. Each of these connected areas represents an individual object—a dimple. Next, the following parameters were calculated for each dimple-object:

Area ${s}_{i}$ was calculated as the sum of the pixels that are part of the object.

To determine to what degree the shape of dimples approaches the circle, we calculated the coefficient of roundness for each

i-th object.

${K}_{ci}$ is the percentage of object pixels that fall in a circle with the same area, whose center is combined with the center of mass of the object [

21]:

where

${f}_{i}$ is the number of object pixels;

${d}_{i}$ is the diameter of the equivalent circle;

$g\left(\overrightarrow{{r}_{m}},{d}_{i}\right)$ is the indicator function that shows whether the

m-th pixel of the object falls within the boundary of the equivalent circle;

$\overrightarrow{{r}_{m}}$ is the radius vector directed from the center of the equivalent circle

${C}_{i}\left({x}_{ci},{y}_{ci}\right)$ to the

m-th pixel of the object with coordinates

$\left({x}_{cm},{y}_{cm}\right)$. Coordinates of the center of mass of the object:

We denote the set of edge pixels of the object by

BP (there is at least one background pixel in their neighbourhood). All of the other pixels of the object will be considered internal. We denote the set of such pixels by

IP. To determine the visual depth of object

${t}_{i}$, we calculated the mean intensity of the object edge

${i}_{i}^{br}$ and the mean intensity of the dimple-object

${i}_{i}^{dm}$:

where

${f}_{i}^{bp}$,

${f}_{i}^{ip}$ is the number of elements in the set of

$BP$ and

$IP$, respectively.

The visual depth of the object in units of image intensity is:

For images with different color depth, the relative visual depth is more informative:

where

${i}^{\mathrm{max}}$ is the maximum possible value of the pixel intensity for the depth of image

${i}_{o}$. Very small objects and objects for which the visual depth was very low (

${f}_{i}<{f}_{i}^{\mathrm{min}}$,

${t}_{i}<{t}_{i}^{\mathrm{min}}$) were removed from further analysis.