## 2 Image Processing and Wavelet Transform  
A substantial body of research exists on arc welding-based additive materials accompanied by gas; however, less attention has been devoted to analyzing surface distortions in welding. Among various machine vision techniques employed to detect surface defects in welding over the past decade, texture analysis has proven to be a powerful tool. This represents a significant starting point in comprehending the surfaces produced by various processes, such as friction stir welding [21]. In some cases, surface distortions can reveal the luminance of the metal surface, and their reflection can be harnessed using a specific model grounded in certain hypotheses and the solution of the image ray equation through specific algorithms [17; 23]. Mathematical transformations are employed for signal analysis and extracting information that is not readily discernible from raw signals. Wavelet transform is one of the most efficient mathematical transformations in signal processing. Wavelets are mathematical functions that rapidly analyze sound, images, and vibrations. Describing the application of one-dimensional discrete wavelet transform is straightforward: this transformation decomposes a signal into two other signals, namely approximation, encompassing low-frequency components, and details, encompassing high-frequency components, as depicted in Figure 4A. This decomposition facilitates the reconstruction of the original signal based on these components. In Figure 4A, H1(z) represents a high-pass filter, and H0(z) represents a low-pass filter, determined based on an essential characteristic in wavelet transform known as the mother wavelet [34]. Figure 4B illustrates the signal decomposition using this transformation. Figure 4: (**A**) Implementation of discrete wavelet transform using low-frequency and high-frequency filters at one level [34]. (**B**) O ne-dimensional signal (1) and its decomposition into approximation (2) and detail (3) using one-dimensional wavelet transform. (**C**) Implementation of two-dimensional wavelet transform at one level using filter banks [34]. The scale and wavelet functions, such as Haar (Haar wavelet) and Daubechies (Daubechies wavelet), among others, are well established. It is possible to approximate a discrete signal in \(l^{2}(z)=\left\{\sum_{n=-\infty}^{\infty}|f[n]|^{2}<\infty\right\}\) using Equation (1) [34; 35]. \[f[n]=\frac{1}{\sqrt{M}}{\sum_{k}W_{\varnothing}[j_{0},k]\varnothing_{j_{0},k}[n ]}+\frac{1}{\sqrt{M}}{\sum_{j=j_{0}}^{\infty}\sum_{k}W_{\psi}[j,k]\psi_{j,k}[n]}. \tag{1}\]  
In the above function, \(f[n]\), \(\varnothing_{j_{0},k}[n]\), and \(\psi_{j_{0},k}[n]\) are in the discrete functions \([0,\text{M}-1]\). The wavelet transform coefficients are obtained by calculating inner products, as shown in Equations (2) and (3). \[W_{\varnothing}[j_{0},k]=\frac{1}{\sqrt{M}}\sum_{n}f[n]\varnothing_{j_{0},k}[n]. \tag{2}\]  
\[W_{\psi}[j,k]=\frac{1}{\sqrt{M}}\sum_{n}f[n]\psi_{j,k}[n]. \tag{3}\]  
Equation (2) represents the approximation coefficients, while Equation (3) represents the detail coefficients [34]. To extend this concept to two dimensions, consider representing a two-dimensional signal or image as a 2D matrix, denoted as \(\text{x}(\text{m}\times\text{n})\). To acquire the 2D wavelet transform, recalling the two-dimensional Fourier transform is helpful. The basis for the modified function is provided by Equation (4)  
\[EXP(j(w_{1}t_{1}+w_{2}t_{2})) \tag{4}\]  
Instead of the transform's EXP(jwt) coefficients, two variable functions give rise to the 2D wavelet transform. The scale and wavelet functions are \(\phi(x,y)\) and \(\psi(x,y)\). The basis functions are expressed in Equations (5) and (6).