1 Introduction

Coal is a heterogeneous porous medium, the pore development and pore structure characteristics (pore size, pore/fracture distribution, and pore interconnectivity) of which directly influence the adsorption, desorption, migration, and enrichment of gas in coal seams (Xu et al. 2019; Zhao et al. 2017). Multiple methods have been used to study the pore structure of coal, including mercury intrusion porosimetry, liquid nitrogen adsorption, nuclear magnetic resonance, electron microscopy, and digital image analysis. Scanning electron microscopy (SEM) imaging provides unique advantages for the quantitative analyses of pore characteristics in porous media (Wu et al. 2016). High-resolution SEM imaging, capable of identifying pores and matrices of different gray levels, has become an important tool for analyzing micro-pore structures (Desbois et al. 2011; Pan et al. 2016). The porous structures in coal exhibit a more complex morphology than those in sandstone or shale, with both fractures and an abundance of micro-pores (Wang et al. 2012). Since the initial fractal development analysis conducted by Mandelbrot, the fractal geometry has been widely used in porous media analyses, showing good results in characterizing the porous structures of coal (Li et al. 2015; Mahamud and Novo 2008; Peng et al. 2011). The fractal dimension (D), an important parameter for the quantitative characterization of pores and fractures, can be experimentally obtained to represent complexity and irregularity in such structures (Bird et al. 2006; Fernández-Martínez and Sánchez-Granero 2016).

Scientists have conducted many coal-structure studies using fractal analyses. (Yao et al. 2008) found that the fractal dimensions of coal range from 2.61 to 2.98, higher than those of other types of rocks such as sandstone, shale, and carbonate. This suggests that coal has a more complicated and inhomogeneous pore structure than other rocks.(Mahamud and Novo 2008) used both porosity, obtained via mercury injection, and fractal analysis to assess the texture of coal: The fractal dimensions and fractal profiles were found to be sensitive to oxidation treatment; this information is useful to follow the changes in coal samples. (Liu and Nie 2016) employed a low-pressure nitrogen gas adsorption technique along with SEM to study methane adsorption in coal and demonstrated that the fractal dimensions of the pores comprehensively reflect the difference in the physical properties of the coal. (Shi et al. 2018) investigated micrometer-sized fractures via micro-CT scanning and fractal analysis, with results showing high interconnectivity in the micro-fracture networks of low-grade coal and greater complexity in the micro-fracture structure of higher-grade coal.

In this study, anthracite coal samples from 12 different sites in the Sihe mining area were investigated using SEM, digital image processing, and fractal analysis to identify the fractal structure and developmental characteristics of their pores and fractures.

2 Experimental

2.1 Coal sample preparation and image acquisition

Twelve coal samples from different sites in the Sihe mining area were selected and numbered. These samples were processed and imaged as follows: (1) Samples with more flat surfaces were cut into thin slices; (2) The surfaces of these slices were cleaned with acetone to remove any stains; (3) The slices were air dried (as coal is an organic substance with poor electrical conductivity); (4) A thin layer of gold was vapor-deposited onto the slices via ion-beam sputtering; (5) The specimens were imaged under an electron microscope at different magnifications. Figure 1 shows the SEM images for the same field of view of the No. 8 coal sample at various magnifications (500, 750, 1000, 1500, and 2000 × for (a), (b), (c), (d), and (e), respectively). As shown, the number of dark pores in the field of view decreases with increasing magnification, but each pore is more prominent.

Fig. 1
figure 1

SEM images of the No. 8 coal sample captured at different magnifications

2.2 Digital image processing

Figure 2 illustrates the basic processes of sampling and quantization. Figure 2a shows a continuous image f (x, y) taken using a camera. The x and y coordinates and grayscale of the image are continuous. To convert to a digital form, sampling and quantization operations were performed on the image. The digitized coordinate value is called sampling, and the digitized grayscale value is called quantization. The one-dimensional function, shown in Fig. 2b, represents the amplitude value (grayscale) of the continuous image along the line segment ABCD indicated in Fig. 2a. The function is sampled at equal intervals along the AD line, as shown in Fig. 2b. Each sampling position is given by a grid point on the ABCD line, and the sampling points are indicated by small white squares on the grayscale curve. Each sampling point (digitized) corresponds to a gray value. On the right side of Fig. 2b, the corresponding gray values are shown, ranging from black (0) to white (255). Figure 2b shows the sampling and quantization processes of the samples. This process is performed line-by-line starting from the vertices of the image to produce a two-dimensional digital image.

Fig. 2
figure 2

Digital image formation: a continuous image, b sampling and quantization

The SEM images were converted to digital images via sampling, which involves dividing the continuous images into M × N matrices to make them spatially discrete, and quantization.

The digital images were stored, calculated, and analyzed using matrices such that a digital image f can be expressed in the form of the following two-dimensional M × N matrix:

$$f(x,y) = \left[ {\begin{array}{*{20}c} {f(0,0)} & {f(0,1)} & \cdots & {f(0,N - 1)} \\ {f(1,0)} & {f(1,1)} & \cdots & {f(1,N - 1)} \\ \vdots & \vdots & \cdots & \vdots \\ {f(M - 1,0)} & {f(M - 1,1)} & \ldots & {f(M - 1,N - 1)} \\ \end{array} } \right]$$
(1)

The following four steps were involved in digitally processing the images:

  1. (1)

    Image pre-processing: The surrounding environment, human factors, and quality of the sensor components affect the image acquisition process. Therefore, it is necessary to reduce the noise and filter the acquired images for subsequent processing and image accuracy. Because of the substantial salt-and-pepper noise in SEM images, a median filter is employed in this study to effectively eliminate the noise (Erkan et al. 2018; Singh et al. 2017; Vijaykumar et al. 2014).

  2. (2)

    Image enhancement: In cases of insufficient exposure or excessive exposure, the gray levels in an image can be limited, causing problems in pore recognition and analysis. Therefore, to improve the image quality and pore clarity, we performed grayscale transformations, wherein a pre-set transformation relationship is employed to adjust the gray level of each pixel in the source image to achieve a target effect. These transformations may be linear or nonlinear, with the latter including logarithmic, gamma, and exponential transformations; threshold functions; and more (Grundland and Dodgson 2007).

Gamma transformations are primarily used to correct images with excessive or insufficient gray levels, thus enhancing their contrast to allow image features to be accurately identified. This is done by performing power-law calculations for every pixel in the original image using the following transformation function:

$$s = c r^{\gamma } \quad r \in \left[ {\text{0,1}} \right]$$
(2)

Here, s represents the gray level after transformation, c is a constant, r represents the normalized gray level, and γ represents the gamma transformation coefficient. Figure 3 shows the gamma correction curves. With 1 as the demarcation, lower γ values (γ < 1) shift the low gray levels to a higher brightness, whereas higher γ values (γ > 1) alter the high gray levels.

Fig. 3
figure 3

Gamma transformation curves

  1. (3)

    Image binarization: To identify pore regions in the image and calculate their percentage, the grayscale images are converted to binary images with only two gray levels (generally assumed to have brightness values of black or white), where black indicates pores (Yao et al. 2009). The threshold value is mainly determined based on the pores in the figure, but all use the same parameter to ensure relative consistency.

  2. (4)

    Histogram thresholding: Balanced histogram thresholding is commonly used to split grayscale images owing to its intuitiveness and ease of implementation. Here, the image pixels with gray levels below a pre-determined threshold are designated as the target region, and the pixels with gray levels above this threshold are excluded.

3 Results

3.1 Pore size distribution characteristics

Figure 4 shows the pore size (diameter) distribution histograms of the No. 8 coal sample at magnifications of 500 × , 750 × , 1000 × , 1500 × , and 2000 × , respectively. These plots reveal a normal distribution of the pore size regardless of the magnification, indicating a higher percentage of small-sized pores (primarily in the nanometer range). This is consistent with the current understanding on coal pores. As the pore size increases, the pore percentage decreases, with larger pores representing only a small percentage of the overall porosity. These plots also show that smaller pores can be identified at higher magnifications; however, as the interval between the pore sizes is greater, there exists a greater discontinuity in the pore size distribution. This is unfavorable for the fractal analyses of pore and fracture characteristics (Liu 2016). Lower magnifications, representing wider fields of view, allow a broad range of pore sizes to be observed, though only larger pores can be identified. Once the magnification is increased to a certain value, the field of view is narrowed, and only a portion of the micro-pores can be observed. The varied distribution characteristics of the pore size under different magnifications demonstrate the importance of magnification in image analyses.

Fig. 4
figure 4

Pore size (diameter) distributions of coal sample #8 captured under different magnifications

3.2 Porosity calculation at the cross section of the coal sample

Figure 5 shows a backscattered electron–scanning electron microscopy image. The color of the minerals in the crack is significantly different from the color of the coal matrix. The mineral is white with high brightness, while the color of the coal matrix is dark.

Fig. 5
figure 5

Backscattered electron (BSE)–scanning electron microscopy image of the No. 8 sample

The gray scale pixel value of the mineral located on the digital image is higher and that of the coal matrix is lower and close to 0. Since the cracked surface shows a darker color due to the depression, the gray value is very close to 0, making the coal matrix to appear black. Therefore, the microscopic morphology of the coal can be divided into three types: mineral filling area with white floc, coal matrix area, and micro-porous or fracture area.

The porosity of coal is the ratio of the total volume occupied by the pores to the overall volume of the coal. Here, however, the porosity studied was not the exact porosity of the coal but the percentage occupied by pores as identified by the electron microscopy image at a selected magnification. In stereology, the characteristics of a 2D cross-section characteristic domain are considered representative of the associated 3D characteristic domain (Vanhecke et al. 2007), allowing the pore characteristics from SEM images taken at different magnifications to be used for coal pore characterization.

The scanning electron microscope image observed in the BSE mode shows that the crack surface is darker due to the depression, and its gray value is very low, representing the color black. An appropriate grayscale threshold is selected, and the BSE image is projected onto a binary map to distinguish microvoids or cracks from the coal matrix and minerals. Figure 6 shows the results of processing the image shown in Fig. 5, where the color black represents a microporous or fracture.

Fig. 6
figure 6

Image processing results of digital image for the No. 8 sample

Two randomly selected positions on each sliced coal sample were imaged using SEM. Each original gray-scale SEM image was then divided into 64 pixels by 64 pixels, and 100 images from each original gray-scale SEM image were randomly selected for analysis. Figure 6 shows the final, processed image of the No. 8 coal sample after digitization, graying, gray-scale transformation, and binarization. The number of pixels in the black regions represents the pores, and the porosity is the ratio of this number to the total number of pixels in the image.

3.3 Calculation of pore and fracture fractal dimensions

The differential box dimension algorithm is used to obtain the fractal dimension. Several algorithms have been proposed for the calculation of box dimensions. Gagnepain (Gagnepain and Roques-Carmes 1986) first proposed a grid counting method to calculate the analysis dimension. (Keller et al. 1987) proposed a probability fractal box algorithm. However, these algorithms calculate the fractal dimension of the image on a 2D basis and are difficult to implement. (Sarkar and Chaudhuri 1992; Sarkar and Chaudhuri 1994) proposed a simple and fast 3D algorithm after summarizing the advantages and disadvantages of previous algorithms, namely the differential box dimension algorithm. The main principle behind this algorithm is as follows:

A grayscale image with a pixel size of M × N (M = N) is subdivided into a sub-block of S × S, with \(r = {S \mathord{\left/ {\vphantom {S M}} \right. \kern-0pt} M}\). The image is thus regarded as a surface in a 3D space. (x, y) is the position coordinate of the image, and f(x, y) is its gray value. The image is divided into a number of S × S grids with a box column on each grid; h is the height of the box column. If the total gray level is G, \(G/h = M/S\). The minimum and maximum values of the grayscale of the image set in the (i, j) grid fall in the kth and lth boxes, respectively:

$$n_{r} = l - k + 1$$
(3)

Here, nr is the number of boxes required to cover the image in the (i, j) grid. Thus, the number of boxes nr required to cover the entire image can be determined as follows:

$$N_{r} = \mathop \sum \limits_{i,j} n_{r} \left( {i,j} \right)$$
(4)

The fractal dimension can be expressed as follows:

$${D} = \mathop {\lim }\limits_{{}} \frac{{\log \left( {N_{r} } \right)}}{\log 1/r}$$
(5)

Based on this formula, we can find the number of fractal dimensions D by linear fitting (Table 1).

Table 1 Calculated porosity and fractal dimension values of coal sample SH-8

The box-counting dimension method was used in this study to calculate the fractal dimensions of the pores and fractures in digitally processed binary images. The calculation results show that the fractal dimension is in the range of 2–3. Because the image can be viewed as a hilly terrain surface whose height from the normal ground is proportional to the image gray value, the fractal dimension is greater than 2 based on the gray images (Sarkar and Chaudhuri 1994). This indicates that the 3D space occupied by the pore structure is limited. The higher the fractal dimension, the more complex the pore structure.

Using the No. 8 coal sample as an example, we obtained 60 fractal dimensions and analyzed them with respect to their corresponding porosities to establish a fractal dimension versus porosity curve (y = 0.2676ln x + 3.1325) with a correlation coefficient of 0.9046 (Fig. 7). This relationship is highly accurate. Figure 7 shows a clear logarithmic relationship between the fractal dimensions of the pores and the porosity.

Fig. 7
figure 7

Fractal dimension vs. porosity cross-plot for the No. 8 coal sample

The fractal dimensions of the other eleven coal samples were similarly calculated, yielding porosity and fractal dimension data that could be fitted to a natural logarithmic curve. Table 2 gives the logarithmic functions and correlation coefficients from the fitting of the data pertaining to the twelve coal samples. As the correlation coefficients are greater than 0.8, the results are considered accurate. The twelve equations, listed in Table 2, demonstrate that porosities close to 1 give a fractal dimension of − 3, resulting in a strong logarithmic relationship between the fractal dimension of the pores and the porosity. This can be expressed as:

Table 2 Logarithmic functions for fractal dimension versus porosity curves
$$D_{f} = \lambda \ln \varphi + 3$$
(6)

where Df is the fractal dimension of the pores, λ is the coefficient of the logarithmic relationship determined by the coal structure, and \(\varphi\) is the porosity.

4 Discussion

4.1 Calculation results and experimental porosity

The porosity of each coal sample was calculated at different magnifications, and the corresponding fractal dimensions of the pores were obtained using the box-counting dimension method (Li et al. 2009). Using the No. 8 coal sample as an example, 100 small figures were taken from the SEM image, and 100 porosities were calculated using the mentioned method, and the average porosity was used as the porosity of the No. 8 coal sample. The same method was used to determine the porosity of the other samples; the results were then compared with the porosity obtained using a porosimeter based on Boyle’s Law, as shown in Fig. 8.

Fig. 8
figure 8

Comparison of porosity calculated from digital images at different magnifications with experimental data

The porosity calculated from the SEM images is different to that obtained using the porosimeter in principle. To analyze this difference, a comparative analysis was performed. As shown, the porosities obtained via digital image analysis are generally lower than the measured values, though this difference is less at higher magnifications. Above a certain magnification, however, the digitally calculated values once again deviate from the actual measurements, with the difference now being significant. Accounting for the pore size distribution characteristics mentioned before, 60 SEM images of each coal sample were taken randomly at 1000 × magnification for the analysis. The experimentally measured porosity values are then compared with the image analysis results, as shown in Fig. 8. The digitally calculated average porosities are consistently lower than the experimental values, with differences ranging from 12.48% to 20.66% and averaging at 15.36%. As shown in Fig. 8, the actual fitting curve is nearly parallel to the theoretical fitting curve but falls to its below, indicating identical trends between the calculated and measured porosities but lower calculated porosity values. As the average porosity calculated via digital image processing was the percent volume occupied by the pores identified using this technique, some micro-pores in the coal may not have been recognized or included (Table 3).

Table 3 Comparison of digitally calculated (at 1000 × magnification) and experimentally measured average porosity

4.2 Micro-pore structure characteristics

The pore structure characteristics are closely related to the porosity and fractal dimension of the pores. (Jiang et al. 2011) assessed the development and pore characteristics of briquettes with different particle sizes using fractal theory, whereas we used the changes in the porosity and pore fractal dimensions as references to investigate the pore structure characteristics (exemplified by the No. 8 coal sample). Equation (6) shows that the fractal dimension varies significantly with the porosity, as shown in Fig. 9a, b: The porosities are 4.03% and 5.13%, respectively, and the fractal dimensions are 2.341 and 2.417, respectively. At higher porosities, the porosity has a minor effect on the fractal dimension, as shown in Fig. 9c, d: The porosities are 9.026% and 10.531%, respectively, while the fractal dimensions are 2.55 and 2.559, respectively. According to Eq. (6), the fractal dimension should approach 3 (the Euclidean dimension) as the porosity approaches 1 (indicating the coal is completely occupied by pores and fractures). This could be explained microscopically as follows: The fractal dimension of pores represents pore complexity. At low porosities, the micro-pores are distributed more independently with a uniform size and occupy a relatively small percentage of the overall volume. As the porosity increases, the pores occupy more space and become less independent, giving rise to a more complex pore structure and rapidly increasing fractal dimension. At large porosities, the percent volume occupied by the pores is relatively high, and the pore structure is complex, characterized by uneven pores. In this situation, an increase in the local porosity does not significantly increase the pore structure complexity nor the fractal dimension.

Fig. 9
figure 9

Processed images of the No. 8 coal sample at 1000 × magnification

4.3 Characteristics of micro-pore and fracture development

Figure 9 shows the porosities and corresponding fractal dimensions. The fractal dimension of the pores increases with porosity; therefore, the fractal dimension is determined by both the porosity and pore structure. For coal samples of equal porosity, the one with the more complex pore structure would have a higher fractal dimension. For example, the porosities, shown in Fig. 9b, e, are 4.03% and 4.32%, respectively, and the fractal dimensions are 2.341 and 2.4759, respectively. These porosities are very close; however, the fractal dimensions differ significantly. In Fig. 9e, a concentrated pore distribution is observed in limited regions. The pore structure is therefore simpler, giving a lower fractal dimension for the same porosity. At higher porosities, more complex pore structures tend to develop with a greater abundance of micro-pores and higher interconnectivity between them, whereas at lower porosities, pore development is reduced, resulting in homogeneous pores with a uniform distribution. These differences in the micro-pore development can be seen in Fig. 9, indicating an uneven pore growth. This leads to the formation of independent small pores around highly interconnected pores with high porosity. These small pores are less porous and poorly connected, significantly hindering the exchange between the pores and the external environment.

5 Conclusions

Twelve anthracite coal samples from the Sihe mining area were studied. Hundred positions were randomly selected from each sliced coal sample and imaged via scanning electron microscopy (SEM). A total of 1200 images were used for the analysis. The porosity and fractal dimension of the samples were calculated using SEM, digital image processing, and box-counting dimension method to analyze the structural characteristics and development of the micro-pores in the coal. The following conclusions can be drawn from the study results:

  1. (1)

    The pore size distribution characteristics vary when different magnifications are used in the SEM analyses of the pore size. Digitally processed SEM images of thin coal slices show consistently lower average porosities relative to the experimental values. The differences between the two groups ranged from 12.480% to 22.018%, with an average of 16.11%. The average porosity calculated via digital image processing was defined as the percent volume occupied by the pores identified in the images. With this method, some micro-pores in the coal might not be recognized or included.

  2. (2)

    The porosity and fractal dimension of the coal samples exhibited a logarithmic relationship. The coefficients of the logarithmic equations were different. Based on this logarithmic relationship, different variation rates in the fractal dimension were found at high and low porosities, which could be explained at a microscopic level.

  3. (3)

    Microscopically, the porosity and fractal dimension of the pores and fractures can be used to characterize the porosity development. At higher porosities, pore structures tend to be more complex with advanced micro-pore development and greater interconnectivity between the pores whereas at lower porosities, the pores are less developed and have a more homogeneous and uniform distribution.