# An Online Detection Method for Coal Dry Screening Based on Image Processing and Fractal Analysis
## 3 Methodologies
### Wavelet Denoising, Average Filter, and Gauss Filter  
The initial image of coal contains many details of the coal surface texture. If the initial image is plainly handled by an edge-processing algorithm without denoising and filtering, then the surface texture will grow into a large part of the edge pictures, and the fractal dimension will be difficult to calculate. Hence, this section aims to use image-preprocessing methods for sharper edge images. In this research, the denoising and filtering process has three steps. Step 1: Wavelet transform is applied to denoised. Step 2: Average filter. Step 3: Gauss filter. [PERSON] proposed the wavelet-denoising method [18; 19; 20], which enriches the theory and application of wavelets. The wavelet expansion for any one-dimensional discrete signal can be represented as  
\[f(t)=\sum_{j,k}a_{j,k}\psi_{j,k}(t)=\sum_{j,k}\Big{\langle}\psi_{j,k}(t),f(t) \Big{\rangle}\psi_{j,k}(t) \tag{5}\]  
where \(\psi(t)\) is the wavelet function. Furthermore, the discrete signal is expanded in one wavelet series as  
\[f(t)=\sum_{k=-\infty}^{\infty}c(k)\varphi_{k}(t)+\sum_{j=0}^{\infty}\sum_{k=- \infty}^{\infty}d(j,k)\psi_{j,k}(t) \tag{6}\]  
in which \(\varphi(t)\) is the wavelet scaling function. The coefficients can be calculated as follows, where the wavelet function and wavelet-scaling function are orthogonal:  
\[c(k)=\langle f(t),\phi_{k}(t)\rangle=\int f(t)\varphi_{k}(t)\mathrm{d}t \tag{7}\]  
\[d(j,k)=\Big{\langle}f(t),\psi_{j,k}(t)\Big{\rangle}=\int f(t)\psi_{j,k}(t) \mathrm{d}t \tag{8}\]  
Figure 3: The image fractal dimension of coal edge in different scale. (**a**) Original coal-edge image (**b**) Fractal dimension. In this paper, the Haar wavelet is adopted for image denoising, and its wavelet function and wavelet-scaling function are given by  
\[\psi(t)= \begin{cases}1,&0<t<0.5\\ -1,&0.5<t<1\\ 0,&\text{otherwise}\end{cases}  \tag{9}\]  
\[\phi(t)= \begin{cases}1,&0<t<1\\ 0,&\text{otherwise}\end{cases}  \tag{10}\]  
There are three steps for image denoising using wavelet transform. Step 1 is image gray matrix wavelet decomposition. The image gray matrix is composed of two-dimensional signals. First, each row of the image gray matrix is decomposed by a one-dimensional discrete wavelet transform (1D-DWT). The coefficients of the wavelet function represent the low-frequency component, whereas the coefficients of the wavelet-scaling function represent the high-frequency component. After the row decomposition, the column decomposition is applied in the same way, and four parts LL\({}_{1}\), LH\({}_{1}\), HL\({}_{1}\), and HH1 are obtained, as demonstrated in Figure 4. There is one wavelet decomposition for the image. The next wavelet decomposition is applied based on the LL\({}_{1}\) part, and parts LL\({}_{2}\), LH\({}_{2}\), HL\({}_{2}\), and HH\({}_{2}\) are obtained in the same way. The different wavelet coefficients of each series are obtained, and the decomposition process is completed by repeating this process. Step 2 is the thresholding operation. This step aims to process the wavelet-function and wavelet-scaling-function coefficients. In this study, the highest-frequency signal of the coal image is the interference signal because the coal surface texture produces a reflection spot. For this reason, the high-frequency wavelet coefficients are cut off or reduced. Step 3 is wavelet reconstruction. The signal is restructured using wavelet coefficients and functions that have been processed. As demonstrated in Figure 5, the surface texture pixels and reflected light pixels of the denoised image are less than the original image. It is also apparent that the coal's edge is much clearer, which will aid in calculating the fractal dimension. Figure 4: The wavelet-transform steps for coal image. The image-filtering algorithms depend on the different filtering templates. For \(N\times N\) filtering templates, the filtered image grayscale \(G^{\prime}\) is given by  
\[G^{\prime}(i,j)=\sum_{i=1}^{N}\sum_{j=1}^{N}G(i,j)M(i,j) \tag{11}\]  
\(G(i,j)\) represents the original grayscale.