# NDT Method for Line Laser Welding Based on Deep Learning and One-Dimensional Time-Series Data
## 2 Method of This Study
### Extraction of the Trajectory of the Weld Center  
After the image was denoised, the center trajectory of the light strip of the original structured-light image was extracted using the Steger algorithm. Common light strip center trajectory-extraction algorithms used in welding inspection include the geometric center method, extreme value method, gray barycentric method, direction template method and Hessian matrix method, all of which, however, have certain limitations. Both the geometric center method and the extreme value method have fast extraction speeds, but they are easily affected by image noise. The gray barycentric method is not sensitive to the translation of the light stripe section, though it can reduce the error caused by the asymmetry of gray distribution. The directional template method has high accuracy and good algorithm robustness, but the positioning accuracy is only at the pixel level, and it also involves a large amount of calculations and slow processing speed. The Hessian matrix method has high accuracy but requires multiple, large-scale two-dimensional Gaussian convolutions, and the calculation speed is slow. In comparison to the algorithms mentioned above, the  
Figure 3: Structured-light image noise reduction process: (**a**) original structured-light image; (**b**) structured-light image after denoising.  
Steger algorithm, based on the Hessian matrix, can achieve sub-pixel-precision positioning of the center of the light strip by finding the Taylor expansion in the normal direction of the light strip with strong robustness and fast processing speeds.  
The Steger algorithm calculates the eigenvalues and eigenvectors based on the Hessian matrix to obtain the normal direction of the light strip center of the structured-light image and then performs Taylor expansion in the normal direction to obtain the corresponding normal extreme point, which is the required light strip center trajectory for sub-pixels [29]. For any point \((i,j)\) on the structured-light image light line, the Hessian matrix is expressed as:  
\[H(i,j)=\begin{bmatrix}\gamma_{ii}&\gamma_{ij}\\ \gamma_{ji}&\gamma_{jj}\end{bmatrix} \tag{1}\]  
where \(\gamma_{ii}\), \(\gamma_{ij}\), \(\gamma_{ji}\), \(\gamma_{jj}\), represent the second-order partial derivatives of the image and \(H(i,j)\) represents the Hessian matrix.  
The eigenvector of the maximum eigenvalue of the Hessian matrix corresponds to the normal direction of the light strip, which is represented by \(\big{(}n_{i},n_{j}\big{)}\). With the point \((i_{0},j_{0})\) as the reference point, the sub-pixel coordinates of the center of the light strip are expressed as:  
\[\big{(}P_{i},P_{j}\big{)}=\big{(}i_{0}+tn_{i},j_{0}+tn_{j}\big{)} \tag{2}\]  
where \(t\) is expressed as:  
\[t=-\frac{n_{i}\gamma_{i}+n_{j}\gamma_{j}}{n_{i}^{2}\gamma_{ii}+2n_{i}n_{j} \gamma_{ij}+n_{j}^{2}\gamma_{jj}} \tag{3}\]  
If \(\big{(}tn_{i},tn_{j}\big{)}\in[-0.5,\ 0.5]\times[0.5,\ 0.5]\)--that is, if the point where the first derivative is zero is located in the current pixel--then \((i_{0},j_{0})\) represents the center point of the light strip, and \(\big{(}p_{i},p_{j}\big{)}\) is expressed as sub-pixel coordinates.  
In the experiment, the text data for the weld center trajectory were obtained using the Steger algorithm. It was found that the distance intervals in the horizontal direction were the same. If the horizontally equal interval distance unit here is regarded as the time unit of the same time interval, we can take it as a special unit of one-dimensional time-series data in the same dimension. By taking the extension direction of the line laser as the X axis and the height information returned by the line laser sensor as the Y axis, we can construct the image shown in Figure 4.  
Figure 4: Visualization of the trajectory data for the weld center.