Digital Image Processing Method for Characterization of Fractures, Fragments, and Particles of Soil/Rock-Like Materials

: Natural soil and rock materials and the associated artiﬁcial materials have cracks, fractures, or contacts and possibly produce rock fragments or particles during geological, environmental, and stress conditions. Based on color gradient distribution, a digital image processing method was proposed to automatically recognize the outlines of fractures, fragments, and particles. Then, the fracture network, block size distribution, and particle size distribution were quantitatively characterized by calculating the fractal dimension and equivalent diameter distribution curve. The proposed approach includes the following steps: production of an image matrix; calculation of the gradient magnitude matrix; recognition of the outlines of fractures, fragments, or particles; and characterization of the distribution of fractures, fragments, or particles. Case studies show that the fractal dimensions of cracks in the dry mud layer, ceramic panel, and natural rock mass are 1.4332, 1.3642, and 1.5991, respectively. The equivalent diameters of fragments of red sandstone, granite, and marble produced in quasi-static compression failures are mainly distributed in the ranges of 20–40 mm, 25–65 mm, and 10–35 mm, respectively. The fractal dimension of contacts between mineral particles and the distribution of the equivalent diameters of particles in rock are 1.6381 and 0.8–3.6 mm, respectively. The proposed approach provides a computerized method to characterize quantitatively and automatically the structure characteristics of soil/rock or soil/rock-like materials. By this approach, the remote sensing for characterization can be achieved. compared


Introduction
Natural geomaterials (soil and rock) and the associated artificial materials have many discontinuous structures such as cracks, fractures, and contacts and possibly produce fragments or particles during geological, environmental, and stress conditions [1][2][3][4][5][6][7]. The distributions of discontinuous structures and particles can determine the physical-mechanical characteristics and failure modes of these materials. The size distribution of fragments reflects the failure behavior or breakage performance. Characterizations of discontinuous structures, particles, and fragments are important for many operations in mining and geotechnical fields, such as geo-mechanical assessment and stability analysis of rock mass, performance analysis of rock breakage, and geometrical characterization of the internal structure of rock-like material. Digital image processing is a digital-based and computer-based approach applying various mathematical algorithms to extract significant information from the images. Digital image processing has been widely used in a range of engineering topics in recent years to determine the characteristics of microscopic and macroscopic structures in the natural and human-made materials [8].
Many efforts have been made to collect and characterize discontinuous structures in rock exposures. Customarily, handheld equipment such as a geological compass-clinometer, a measuring tape, and a roughness profile gauge were used to make the in situ measurement of discontinuity geometry of rock mass exposures. This method was undesirable for several reasons: high operation risk, limited measurement scale, high time consumption, and no uninterpreted record of the rock face. As an alternative approach to in situ measurement, photogrammetry allows for discontinuity geometry to be measured from remotely sensed photographs of rock mass exposures [9,10]. Afterwards, digital images were used instead, which promoted the production of automated methods to firstly detect discontinuities and to then analyze discontinuity geometry as the data comprising digital images can be mathematically processed [11]. Some digital image processing techniques, such as the greyscale threshold, greyscale smoothing, segmentation, and edge detection, have been used to identify discontinuity traces in digital images of rock mass exposures to characterize the fracture length, orientation, and position [11][12][13]. In these efforts, it was difficult to fully reflect the information of the natural rock mass exposure with graylevel images. The complication of the recognition of discontinuity traces defined by edges resulted in the binary image from segmentation containing a large number of error pixels. The optimal threshold value for each image impeded the creation of an automatic mapping tool [14]. The manual, automatic, and semiautomatic methods had been used to characterize discontinuity traces using photographs of rock exposures, and the case studies on actual rock images were taken to conduct comparative analyses to quantify the accuracy of fracture detection and characterization [11,14] Fragmentation is an important operation in order to control and minimize the loading, hauling, crushing, classification, and processing costs in mining and minerals engineering [15][16][17][18]. Many methods based on photo-analysis were proposed to estimate the size distribution of rock fragments [19][20][21][22]. The aforementioned methods were performed by hand or through image processing techniques by computer, which must delineate the individual rock fragments in an image. A computer program using statistical procedures was developed to automatically determine the size distribution of rock fragments based on high-resolution images [23]. Subsequently, digital image software was developed to evaluate fragmentation, which gradually became a worldwide accepted tool in the mining and mineral processing industries with the emergence of the continuous fragmentation monitoring system [24]. Some scholars compared fragmentation measurements using photographic and image analysis techniques on the actual images of fragments. They found that the photographic method was time-consuming, and manual editing was required to improve the accuracy of the image processing method [25]. The image analysis approaches could reach a satisfactory accuracy via comparisons with calculations from manual outlining and measurement [23][24][25].
The aforementioned methods based on image analyses provide useful tools for estimating the fracture and block size distributions. However, there is still a lack of a comprehensive and consolidated method to automatically recognize discontinuous structures and to characterize the distributions of discontinuous structures and block sizes with multiple scales. In addition, the graying process decreases the dimensionality of multicolor images and reduces recognition accuracy, although it is a common process in demarcations based on image processing techniques. This study proposed a digital image processing method based on the color gradient distribution of a multicolor image. This approach was used to automatically recognize the outlines of fractures/cracks/contacts, fragments, and particles. Then, the fracture network, block size distribution, and particle size distribution were quantitatively characterized. Case studies were conducted to confirm the proposed method.

Image Processing Method Based on Color Gradient
The colors of fractures in rock and the outlines of rock fragments or particles are different from the colors of other zones in a digital image. There are high color gradient values at rock fractures and the outlines of rock fragments or particles. Therefore, a color gradient-based image processing method was proposed to automatically recognize the outlines of rock fractures, rock fragments, and rock particles. Then, the fractal dimension of the fracture network in rocks and the particle size distribution of rock fragments or particles can be characterized. The detailed steps are shown in Figure 1 and described as follows: Step 5-Calculate the area, AO S , of the connected zone enclosed by each outline o the rock fragment or rock particle, and convert AO S into the equivalent diameter d o a circle for which the area A S is equal to the area enclosed by outline, which can be ex pressed as Then, the frequency histograms and distribution curves of equivalent diameters o the rock fragments or rock particles can be drawn from the size statistics. Figure 1. Flowchart of the image-processing method for analyzing the properties of rock fracturing and block/particle size distribution.

Description of the Proposed Image Processing Method
In order to clearly describe the proposed image processing method, the calculation processes of the fractal dimension of the world coastline and the size distribution of th connected land were taken as the example shown in Figure 2. The calculation process wa similar to the analyses of the fractal dimension and the size distribution of rock fractures rock fragments, or rock particles. First, the world coastline map (Figure 2a) was simplified into a graph (Figure 2b), with the different colors denoting seawater and land, by markin seawater and land with blue and white, respectively, using a drawing software. Secondly the mean of the color gradient was calculated and drawn in the color gradient distribution  Boundary of fracture, fragment or particle Figure 1. Flowchart of the image-processing method for analyzing the properties of rock fracturing and block/particle size distribution.
Step 1-Read the original color image consisting of three primary colors (red, green, and blue) to produce an image matrix expressed as Equation (1) including pixel locations and the associated tricolor values.
where C m×n×3 is the image matrix and c ijk is the tricolor value of a pixel.
Step 2-Calculate the color gradient based on Equation (2) to achieve a gradient magnitude matrix expressed as Equation (3), including gradient magnitudes of tricolor values. In addition, the isolated pixel with a peak value of color gradient will be deleted for simple noise reduction. The box with 3 × 3 pixels was used to find the insolated pixel with a peak value of color gradient by one pixel as the set size in the search. If the color gradient in the center position presents a sudden rise, this pixel will be considered noise.

of 13
where g ijk is the gradient magnitude, G (m−1)×(n−1)×3 is the gradient magnitude matrix, and ∆x and ∆y are the differential steps in the horizontal and vertical directions for calculating the gradient magnitude, in which the steps are set to one pixel in the horizontal and vertical directions.
Step 3-Outline the rock fractures or the boundaries of rock fragments or particles, and use binarization to store the locations of outlines in a binary digital image according to the color gradient magnitude and the following criteria: where g ij is the mean of the gradient magnitude values of the tricolor values and a is the threshold value to recognize the outline.
Step 4-Calculate the fractal dimension of the fracture network in rock to quantitatively characterize the developmental degree of fractures in rock. The box-counting dimension is used to determine the fractal property of the fracture network. The binarized image is covered by a sequence of square grids with ascending sizes through a measuring box scale along the horizontal and vertical measuring directions. For each grid, the number of boxes intersected by the fracture network, N(δ), and the lengths of the sides of the boxes, δ, are recorded. Then, the natural logarithm of N(δ) is plotted against the natural logarithm of 1/δ and the straight line is regressed by Equation (6). The slope of the regressed straight line is the fractal dimension, D F .
where C is a regressed constant.
Step 5-Calculate the area, S AO , of the connected zone enclosed by each outline of the rock fragment or rock particle, and convert S AO into the equivalent diameter d of a circle for which the area S A is equal to the area enclosed by outline, which can be expressed as Then, the frequency histograms and distribution curves of equivalent diameters of the rock fragments or rock particles can be drawn from the size statistics.

Description of the Proposed Image Processing Method
In order to clearly describe the proposed image processing method, the calculation processes of the fractal dimension of the world coastline and the size distribution of the connected land were taken as the example shown in Figure 2. The calculation process was similar to the analyses of the fractal dimension and the size distribution of rock fractures, rock fragments, or rock particles. First, the world coastline map (Figure 2a) was simplified into a graph (Figure 2b), with the different colors denoting seawater and land, by marking seawater and land with blue and white, respectively, using a drawing software. Secondly, the mean of the color gradient was calculated and drawn in the color gradient distribution graph shown in Figure 2c. Then, the coastline was recognized and located in a binary digital image shown in Figure 2d. Finally, the fractal dimension of the coastline was obtained using the regression analysis (Figure 2f) of the box-counting dimension. The schematic diagram of the measuring process for calculating the box-counting dimension is shown in Figure 2e. Meanwhile, the connected domain of land ( Figure 2g) was distinguished. The areas of connected domains were calculated and stored in a vector to obtain the frequency histogram and cumulative distribution curve (Figure 2i tained using the regression analysis (Figure 2f) of the box-counting dimension. The sc matic diagram of the measuring process for calculating the box-counting dimensio shown in Figure 2e. Meanwhile, the connected domain of land ( Figure 2g) was dis guished. The areas of connected domains were calculated and stored in a vector to ob the frequency histogram and cumulative distribution curve (Figure 2i) of land sizes calculating equivalent diameter, as shown in Figure 2h. The fractal dimension of wo coastline is 1.3625, and the land sizes are mostly distributed below 2000 km, as determi by analyses from the proposed digital image processing method.

Fractal Dimension of Fracture Network
Rock and soil materials often produce a crack or fracture network under loads fr geological and environment effects. It is an important task to characterize the fracture work to quantitatively determine the development and distribution of fractures. For soil material of a mud layer under water, many cracks (Figure 3a) will emerge after water recedes, induced by tensile stress generated from water evaporation, thermal pansion, and cold shrinkage under high temperatures and drought conditions. The p posed image-processing method was used to determine the fractal dimension of crack the dry mud layer. The calculation process is shown in Figure 3. The result shows that fractal dimension of cracks in the dry mud layer is 1.4332.

Fractal Dimension of Fracture Network
Rock and soil materials often produce a crack or fracture network under loads from geological and environment effects. It is an important task to characterize the fracture network to quantitatively determine the development and distribution of fractures. For the soil material of a mud layer under water, many cracks ( Figure 3a) will emerge after the water recedes, induced by tensile stress generated from water evaporation, thermal expansion, and cold shrinkage under high temperatures and drought conditions. The proposed image-processing method was used to determine the fractal dimension of cracks in the dry mud layer. The calculation process is shown in Figure 3. The result shows that the fractal dimension of cracks in the dry mud layer is 1.4332.
For a ceramic panel that is a brittle material made by artificial sintering of clay, the crack network (Figure 4a) will be produced by thermal expansion and cold shrinkage during high-temperature sintering and long-term service conditions. As shown in Figure 4,  For the rock mass, there are many cracks or fractures (Figure 5a) due to geologi processes including tectonics, weathering, and diagenesis, and the effects of human-ma excavation. It is important for quality assessments, strength prediction, and stability an ysis of rock masses to characterize the fracture distribution. As shown in Figure 5, proposed method was used to determine the fractal dimension of the fracture network rock mass based on the color gradient-based processing of a digital image of a natu rock mass. By distinguishing the color differences of rock fractures from color gradi distribution, the rock fractures were recognized from the natural rock mass. The frac dimension of the fracture network regressed to 1.5991.
The aforementioned application examples show that the proposed image-process method based on the color gradient distribution of a digital image can automatically a   For a ceramic panel that is a brittle material made by artificial sintering of clay crack network (Figure 4a) will be produced by thermal expansion and cold shrinkage ing high-temperature sintering and long-term service conditions. As shown in Figu the proposed image processing method was used to determine the fractal dimension the crack network in the ceramic panel. The calculated fractal dimension is 1.3642. For the rock mass, there are many cracks or fractures (Figure 5a) due to geolog processes including tectonics, weathering, and diagenesis, and the effects of human-m excavation. It is important for quality assessments, strength prediction, and stability a ysis of rock masses to characterize the fracture distribution. As shown in Figure 5, proposed method was used to determine the fractal dimension of the fracture networ rock mass based on the color gradient-based processing of a digital image of a nat rock mass. By distinguishing the color differences of rock fractures from color grad distribution, the rock fractures were recognized from the natural rock mass. The fra dimension of the fracture network regressed to 1.5991.
The aforementioned application examples show that the proposed image-proces method based on the color gradient distribution of a digital image can automatically programmatically recognize cracks or fractures. Then, the associated fractal dimensio the crack or fracture network in soil and rock materials can be calculated. The results provide quantitative information to determine the distribution characteristics and de opment degree of cracks or fractures in soil and rock materials.  For the rock mass, there are many cracks or fractures (Figure 5a) due to geological processes including tectonics, weathering, and diagenesis, and the effects of human-made excavation. It is important for quality assessments, strength prediction, and stability analysis of rock masses to characterize the fracture distribution. As shown in Figure 5, the proposed method was used to determine the fractal dimension of the fracture network in rock mass based on the color gradient-based processing of a digital image of a natural rock mass. By distinguishing the color differences of rock fractures from color gradient distribution, the rock fractures were recognized from the natural rock mass. The fractal dimension of the fracture network regressed to 1.5991.
The aforementioned application examples show that the proposed image-processing method based on the color gradient distribution of a digital image can automatically and programmatically recognize cracks or fractures. Then, the associated fractal dimension of the crack or fracture network in soil and rock materials can be calculated. The results can provide quantitative information to determine the distribution characteristics and development degree of cracks or fractures in soil and rock materials.
In order to compare the proposed methodology with the existing methods, the aforementioned actual image of fracture network shot from the on-site rock mass were used to produce the calculation time and fractal dimensions by different image processing Mathematics 2021, 9, 815 7 of 13 methods. The results were compared to the real situation by manual outlining, which can be regarded as a real result of fractal dimension. In the comparisons, the color gradientbased method proposed in this study was compared with the gray gradient-based, binary gradient-based, color image-based, gray image-based, and binary image-based methods. Finally, the proposed method was confirmed by manual outlining and the color-based method. The gradient-based methods were based on the gradient distribution of color, gray, or binary values for outlining the fracture network. The image-based methods were based on the tricolor, gray, or binary values for outlining the fracture network. The used computer was installed with Windows 10 × 64 system, Intel(R) Core(TM) i5-6200U CPU 2.30 GHz and RAM 8 GB. The comparative results are shown in Figure 6 and summarized in Table 1. Manual outlining can provide the real value of fractal dimension for conducting comparisons. However, the work outlining the fracture consumed four hours, which was a time-consuming and laborious task. Therefore, the image-processing methods were created to solve such a problem. The color gradient-based method proposed in this study consumed the longest calculation time for fracture identification and fractal dimension because it was required to determine the tricolor and the associated gradient. Nevertheless, it only took 1490.733 ms to produce the results. The results of fracture network and its fractal dimension achieved by the proposed color gradient-based method were closest to the results obtained by manual outlining. The difference rate was only 0.33%. Therefore, the calculation accuracy and calculation efficiency of the proposed method were confirmed by the comparisons. In order to compare the proposed methodology with the existing methods, the afo mentioned actual image of fracture network shot from the on-site rock mass were used produce the calculation time and fractal dimensions by different image processing met

Block Size Distribution of Rock Fragments
A number of rock fragments with multiple shapes and sizes will be produced when rock failure occurs in rock mechanical experiments and field excavations. The block size distribution of rock fragments is an important parameter for estimating the energy consumption characteristic of a rock after peak strength. The digital image processing approach was proposed to calculate the block size distribution of rock fragments. Firstly, the boundaries of rock fragments will be drawn and stored in a binary color matrix using the recognition criterion based on the color gradient distribution of the original image of rock fragments. Then, the areas of the connected domains surrounded by fragment boundaries were calculated, and these areas were converted into circles with the same area values and equivalent diameters. Finally, the frequency histogram and cumulative distribution curve of the equivalent diameters of rock fragments can be achieved. Granite, marble, and sandstone, which are classified as magmatic, metamorphic, and sedimentary rocks, respectively, are commonly used rock specimens for investigating the mechanical properties of brittle materials. Therefore, rock fragments of red sandstone, granite, and marble were used as application examples to show the specific processes of the proposed image processing approach to characterize the block size distribution, as shown in Figure 7. The analysis results show that the equivalent diameters of fragments are mainly distributed in the ranges of 20-40 mm, 25-65 mm, and 10-35 mm for red sandstone, granite, and marble, respectively, under the same experimental conditions. Although the main distribution range of fragment diameter can be reflected, the distribution modality of fragment diameters did not present a special strict type with unimodality, bimodality, or multimodality because the number of fragments was few and did not have the statistical law. In addition, the randomness of rock fracturing also contributed to that result.
Based on the proposed image processing approach, the boundaries of the rock fragments can be clearly recognized and the connected domains can be accurately demarcated. Then, an accurate frequency histogram and cumulative distribution curve of equivalent diameters can be automatically produced to conduct visualization of the block size distribution of rock fragments. Therefore, the proposed method can be used to characterize the block size distributions of rock fragments produced during opencast blasting, underground mining, tunneling, ore-rock crushing, etc.

Fractal Dimension and Particle Size Distribution of Microparticles in Rock
Rocks are formed by cementation of many microparticles, influenced by long-term geological processes. The types, shapes, sizes, and distribution and cementation characteristics of microparticles determine the physical-mechanical properties of rock material. The fractal dimension of contacts between microparticles can reflect the shapes and the associated distribution of microparticles in rock. The equivalent diameter of particles and the associated distribution can characterize the particle size distribution in rock. The pro-posed digital image processing method can be simultaneously used to calculate the fractal dimension of contacts and the particle size distribution of microparticles in rock, as shown in Figure 8. Based on the color gradient distribution, the contacts between microparticles can be recognized, and then the connected domains of microparticles can be demarcated. Then, the fractal dimension of contacts and the equivalent diameter distribution of particles can be produced by using the calculation processes of the box-dimension and equivalent diameter. The analysis results show that the fractal dimension of the contacts is 1.6381. The equivalent diameters of the microparticles are mainly distributed from 0.8-3.6 mm with a bimodality distribution, which means the sizes of microparticles are concentrated near 1 mm and 2-3 mm for the mentioned rock material. The reason for that bimodality may be determined by the mineral particle composition, bonding form, and special geological conditions of diagenesis. That result indicated that the particle elements with sizes of 1 mm and 2-3 mm be produced and reserved during the long process of diagenesis. matics 2021, 9, x FOR PEER REVIEW 10 o distribution of rock fragments. Therefore, the proposed method can be used to charac ize the block size distributions of rock fragments produced during opencast blasting, derground mining, tunneling, ore-rock crushing, etc.

Fractal Dimension and Particle Size Distribution of Microparticles in Rock
Rocks are formed by cementation of many microparticles, influenced by long-te geological processes. The types, shapes, sizes, and distribution and cementation char teristics of microparticles determine the physical-mechanical properties of rock mater The fractal dimension of contacts between microparticles can reflect the shapes and associated distribution of microparticles in rock. The equivalent diameter of particles a the associated distribution can characterize the particle size distribution in rock. The p posed digital image processing method can be simultaneously used to calculate the frac dimension of contacts and the particle size distribution of microparticles in rock, as sho in Figure 8. Based on the color gradient distribution, the contacts between micropartic

Conclusions
A digital image-processing method based on color gradient distribution was p posed to automatically recognize the outlines of rock fractures, rock fragments, and ro particles. By using this method, the fracture network, block size distribution, and parti size distribution of rock can be quantitatively characterized. The proposed approach c automatically produce the fractal dimension of a fracture or contact network in rock a the size distribution curves of rock fragments and mineral particles. These approaches c quantitatively characterize the rock structure characteristics by means of a comput Based on this study, the following conclusions can be drawn: (a) The calculation examples show that the proposed image-processing method c automatically and programmatically recognize cracks or fractures and then calculate fractal dimensions of crack or fracture networks. The fractal dimension can quantitativ reflect the distribution characteristic and development degree of cracks or fractures in s and rock materials. The calculation results show that the fractal dimensions of cracks the dry mud layer, ceramic panel, and natural rock mass are 1.4332, 1.3642, and 1.59 respectively.
(b) The outlines of rock fragments produced after rock failure can be clearly rec nized by the proposed image-processing method. Then, the frequency histogram and mulative distribution curves of equivalent diameters of rock fragments can be automa cally obtained to characterize the block size distribution of rock fragments. The propos method can be used to characterize the block size distributions of rock fragments p duced in rock fragmentations during opencast blasting, underground mining, tunneli and ore-rock crushing. The calculation examples show that the equivalent diameters fragments of red sandstone, granite, and marble produced in compression failures mainly distributed in the ranges of 20-40 mm, 25-65 mm, and 10-35 mm, respectively

Conclusions
A digital image-processing method based on color gradient distribution was proposed to automatically recognize the outlines of rock fractures, rock fragments, and rock particles. By using this method, the fracture network, block size distribution, and particle size distribution of rock can be quantitatively characterized. The proposed approach can automatically produce the fractal dimension of a fracture or contact network in rock and the size distribution curves of rock fragments and mineral particles. These approaches can quantitatively characterize the rock structure characteristics by means of a computer. Based on this study, the following conclusions can be drawn: (a) The calculation examples show that the proposed image-processing method can automatically and programmatically recognize cracks or fractures and then calculate the fractal dimensions of crack or fracture networks. The fractal dimension can quantitatively reflect the distribution characteristic and development degree of cracks or fractures in soil and rock materials. The calculation results show that the fractal dimensions of cracks in the dry mud layer, ceramic panel, and natural rock mass are 1.4332, 1.3642, and 1.5991, respectively.
(b) The outlines of rock fragments produced after rock failure can be clearly recognized by the proposed image-processing method. Then, the frequency histogram and cumulative distribution curves of equivalent diameters of rock fragments can be automatically obtained to characterize the block size distribution of rock fragments. The proposed method can be used to characterize the block size distributions of rock fragments produced in rock fragmentations during opencast blasting, underground mining, tunneling, and ore-rock crushing. The calculation examples show that the equivalent diameters of fragments of red sandstone, granite, and marble produced in compression failures are mainly distributed in the ranges of 20-40 mm, 25-65 mm, and 10-35 mm, respectively.
(c) Based on the proposed method, the contacts between microparticles in rock can be accurately recognized, and the connected domains of microparticles can be demarcated subsequently. Then, the fractal dimension of contacts and the equivalent diameter distribution of particles can be calculated and are 1.6381 and 0.8-3.6 mm, respectively, for the mineral particles in the rock specimens.
(d) The comparative analyses show that the proposed color gradient-based method presents the best performance and is closest to the actual result assessed by manual outlining. Compared to the existing methods, the proposed method is a comprehensive and consolidated approach that can automatically recognize discontinuous structures and characterize the distributions with multiple scales. Meanwhile, this approach fully utilizes multicolor information in color images. The above improvement significantly increases the recognition accuracy.