## 3 Methodology of Image Post-Processing for Crack Evaluation  
Python code was developed to evaluate the fracture of coal samples using functions implemented in the _Python OpenCV_ library [50]. First, the color image of a crack sample is resized and transformed to a grayscale image using _OpenCV_ commands _resize()_ and _crtColor()_, respectively. Then, the bilateral filter _bilateralFilter()_ is employed. This filter is highly effective in noise removal while keeping edges sharp. Next, the image brightness and its contrast are accordingly adjusted. To compute the binary pixel matrix, adaptive Gaussian thresholding adaptive _threshold ()_ is used where entries with ones corresponding to dark regions. Pixels representing the disc with the sample are selected using the user-defined function _crop_center()_. The cropped disc region's connected components are analyzed using the function _connectedComponentWithStats()_, which computes a Boolean image's connected components and produces statistical output for each label. The _OpenCV_ implementation of this function is based on the Spaghetti Labeling algorithm of [PERSON] et al. [51]. The components with an area less than the prescribed threshold are considered negligible. This step is necessary to remove those pixels that constitute noise and do not represent the real cracks. Those pixels of the processed image which do not represent the fracture are removed manually. Finally, pixel groups disconnected by only a few white pixels are  
Figure 3: Experimental equipment and process. Figure 2: Sampling location in the Karaganda region in Kazakhstan. reconnected using two morphological operations _erode()_ and _dilate()_. Statistical sample characteristics are computed using _OpenCV_, _numpy_, _pandas_ libraries, while the visualization is realized using _matplotlib_ and _seaborn_ libraries. The user-defined function _get_params()_ returns the statistical parameters listed in Table 1.  
The total crack area (TCA) is defined as a ratio between the area occupied by cracks (\(A_{C}\)) and the total area of the analyzed area (\(A_{I}\)), and it directly determines the degree of surface cracking. The total crack area is evaluated as follows:  
\[TCA=\frac{A_{C}}{A_{I}}\cdot 1000\,\left[\frac{\text{cm}^{2}}{\text{m}^{2}} \right], \tag{1}\]  
while the crack density was calculated according to  
\[CD=\frac{\sum_{i=1}^{n}N_{C,i}}{n\cdot L_{s}}\,\left[\frac{1}{m}\right], \tag{2}\]  
where \(L_{S}\) is the length of the test line, i.e., the diameter of the analyzed area in the longitudinal direction, \(N_{C,i}\) is the number of cracks intersecting the \(i\)-th test line, and \(n=4\) stands for the number of test lines in a single sample [52]. The area occupied by cracks (\(A_{C}\)) and the total area of the analyzed region (\(A_{I}\)) is measured in pixels. \(A_{C}\) stands for the number of black pixels corresponding to zero entries in the Boolean image, while \(A_{I}=480^{2}\) is its total number of pixels. In the formula for computing TCA, the multiplier 10,000 is to show the result in \(\left[\frac{\text{cm}^{2}}{\text{m}^{2}}\right]\). The length of each crack was calculated using outputs of the _OpenCV_ function _connectedComponentsWithStats_. To calculate the crack lengths, the list of thicknesses of each fracture is created as follows. The thickness is evaluated as the area of the fracture divided by the length of the diagonal of the bounding box surrounding it. After that, we take the average thickness of all cracks as the median of the list of thicknesses. Then, the list of lengths is created by dividing the area of each crack by the average thickness. For each parameter \(p\) listed in Table 1, its relative change \(\delta_{p}\) is defined as  
\[\delta_{p}=\frac{p_{a}-p_{b}}{p_{b}}, \tag{3}\]  
where \(p_{a},\ p_{b}\) correspond to the values of parameter \(p\) after and before LN\({}_{2}\) treatment. For instance, \(\delta_{TCA}\) denotes the relative change in TCA.