Two-dimensional SEM image-based analysis of coal porosity and its pore structure

A quantitative analysis of the porosity, pore size distribution, and fractal dimensions of pores is signiﬁcant for studying the pore structure characteristics of coal. This study utilized 12 anthracite coal samples from the Sihe mining area to explore the pore structure characteristics of the coal therein. Hundred randomly selected points on each sliced coal sample were imaged via scanning electron microscopy, and a total of 1200 images were used for the analysis. The porosity and fractal dimensions of the coal samples were analyzed via digital image processing and box-counting dimension methods. This method is characterized by extensive graphical analysis, and the results are based on statistical methods. These were also used to analyze the structural and development characteristics of the microscopic pores in the coal. The results reveal that the surface porosity obtained via digital image processing was 16.11% lower than that measured experimentally. The fractal dimension and porosity of the pore surface were ﬁtted to a natural logarithmic curve. The rate of change in the pore fractal dimension depends on the porosity such that, to some degree, a greater porosity is associated with more complex pore structures, a higher degree of micropore development, and improved pore connectivity. liquid nitrogen adsorption, nuclear magnetic resonance, electron microscopy, and digital image analysis.


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). Highresolution 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 lowpressure 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.

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 ionbeam 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 9 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. 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.

Digital image processing
The SEM images were converted to digital images via sampling, which involves dividing the continuous images into M 9 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 9 N matrix: The following four steps were involved in digitally processing the images: (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 saltand-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) 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-  Two-dimensional SEM image-based analysis of coal porosity and its pore structure law calculations for every pixel in the original image using the following transformation function: Here, s represents the gray level after transformation, c is a constant, r represents the normalized gray level, and c represents the gamma transformation coefficient. Figure 3 shows the gamma correction curves. With 1 as the demarcation, lower c values (c \ 1) shift the low gray levels to a higher brightness, whereas higher c values (c [ 1) alter the high gray levels.
(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. (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. Figure 4 shows the pore size (diameter) distribution histograms of the No. 8 coal sample at magnifications of 500 9 , 750 9 , 1000 9 , 1500 9 , and 2000 9 , 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. 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.

Pore size distribution characteristics
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.
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.

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 9 N (M = N) is subdivided into a sub-block of S 9 S, with r ¼ S=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 9 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: Here, n r is the number of boxes required to cover the image in the (i, j) grid. Thus, the number of boxes n r Fig. 6 Image processing results of digital image for the No. 8 sample G. Zou et al. required to cover the entire image can be determined as follows: The fractal dimension can be expressed as follows: Based on this formula, we can find the number of fractal dimensions D by linear fitting (Table 1).
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.
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 Two-dimensional SEM image-based analysis of coal porosity and its pore structure fractal dimension of the pores and the porosity. This can be expressed as: where D f is the fractal dimension of the pores, k is the coefficient of the logarithmic relationship determined by the coal structure, and u is the porosity.

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 boxcounting 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. 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 9 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).

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 Two-dimensional SEM image-based analysis of coal porosity and its pore structure 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.
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.

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 micropores in the coal. The following conclusions can be drawn from the study results: (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) 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) 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.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons. org/licenses/by/4.0/.