## 2 Materials and Methods
### Intelligent Inspection System
#### 2.3.2 Fourier Feature Algorithm  
According to [1,2,4,15,16], PCA, WT, and FT are common methods for feature extraction in industrial applications. WT and FT require other statistical analyses, such as VMD or EMD, to generate features. However, PCA, VMD, and EMD cannot be used in real CNC monitoring and diagnosis online. On the other hand, Fourier descriptors are a set of methods for feature extraction based on the FT used in many industrial applications because they generate a one-dimensional feature vector composed of a low number of elements that represent the contour morphology of an object [31]. The feature vector is a highly compressed way of generating frequency signatures representing objects' contours. Fourier descriptors generate results with precision similar to WT and other FT methods but with significantly low computational complexity in CNC monitoring, real time, and industrial applications [32,33]. Then, Fourier descriptors are the foundations for feature extraction for the NIIM. Subsequently, \(I_{a,\beta}(x,y)^{G}\) is segmented using the method of [34], generating an output \(B_{a,\beta}(x,y)\) that divides the image into two regions: the piece and the illumination of the vision machine. The next step is to find the piece profile that computes the edge between the part and the illumination, defining \(P_{a,\beta}(x,y)=B_{a,\beta}(x,y)*h\), where \(h=\{1,-1\}\). Next, \(P_{a,\beta}(x,y)\) is scanned from left to right to determine the position \((x,y)\) of pixels with values  
Figure 10: Image \(I_{d,L}(x,y)^{RGB}\) and it \(I_{d,L}(x,y)^{G}\) channels. Figure 9: Images captures for curve \(I_{d,C}(x,y)^{RGB}\), line \(I_{d,L}(x,y)^{RGB}\), and slope \(I_{d,S}(x,y)^{RGB}\). different from zero in \(P_{a,\beta}(x,y)\), as shown in Figure 11. This scanning generates a profile feature vector \(r_{a,\beta}(n)\) described as the Euclidean distance [35] and defined by Equation (3). \[r_{a,\beta}(n)=\sqrt{x(n)^{2}+y(n)^{2}} \tag{3}\]  
The contour profile feature vector \(r_{a,\beta}(n)\) is converted into a signature \(l_{d,\beta}(x,y)^{SG}\) by the algorithm of NIIM using the \"Canny\" function for edge detection proposed by [36]. The \(l_{d,\beta}(x,y)^{SG}\) allows for extracting patterns, characteristics, and detailed information for analysis of the \(l_{d,\beta}(x,y)^{SG}\) intricacies, offering insights into the nuanced effects of the machining process on both shape and form. The visual representations in Figures 12-14 showcase how the signal \(r_{a,\beta}(n)\) effectively highlights the form deviations within each \(l_{d,\beta}(x,y)^{SG}\), providing a comprehensive understanding of the signature's structural variations. The \(I_{d,\beta}(x,y)^{SG}\) analysis serves as a foundation for the subsequent implementation of the fast Fourier transform (FFT) to extract Fourier descriptors, enhancing the quantitative characterization of the \(I_{d,\beta}(x,y)^{SG}\) features. The subsequent step involves implementing the FFT to determine the Fourier descriptors of \(r_{\alpha,\beta}(n)\), as defined in Equation (4). \[R_{\alpha,\beta}(k)=\frac{1}{N}\sum_{n=0}^{N-1}r(n)_{\alpha,\beta}exp^{-2\pi kn /N} \tag{4}\]  
where \(k\) is the frequency component, \(N\) is the size of the profile. Equation (4) is computed with the Fast Fourier transform radix 2. Based on different works that apply Fourier descriptors in shape analysis as [33; 34], the representation of the calibration piece profile Fourier features is defined by Equation (5) as the magnitude of Equation (4) divided by \(N\) as follows:  
\[M_{\alpha,\beta}(k)=\frac{\sqrt{Re(R_{\alpha,\beta}(k)^{2}+Im(R_{\alpha,\beta} (k)^{2})}}{N} \tag{5}\]  
where \(M_{\alpha,\beta}(k)\) is a profile feature vector composed of a real number that describes the magnitude frequencies of \(r(n)\) contour properties. However, the profile feature is the Fourier spectrum signature (FSS). The FSS describes the signature form properties and the concentration of the energy of the frequency components in \(M_{\alpha,\beta}(k)\).