## 3 The Improved Laser Line Extraction  
As shown in Figure 7, any point on the world coordinate system can be transformed into pixel coordinates. In order to obtain the target 3D information, the object position information needs to be restored from the laser line. The extraction of the laser line center line plays an important role in this system, which is the essential step in the process of obtaining high-precision 3D model data of the lithium battery surface. The accuracy of laser line extraction affects the subsequent 3D reconstruction, data processing, defect identification classification, and other related work. Therefore, it is important to choose the appropriate laser line extraction method. The continuous gray saturation often occurs in the central line extraction process, which is also known as the \"flat top\" phenomenon. As shown in Figure 7, there is a situation where multiple pixels reach the grayscale value of 255, so that the above centerline extraction method cannot reflect the true position of the laser line to some extent, resulting in the laser centerline cannot be accurately extracted. Therefore, it is necessary to solve the  
Figure 5: The smoothing results of the Gaussian blur. Figure 6: The image segmentation process. \"flat top\" phenomenon where the grayscale value is saturated, and then put forward the method with higher precision in the centerline extraction. As shown in Figure 7, there is an image of the grayscale distribution of pixel coordinates, which is perpendicular to the direction of the laser stripe. The grayscale strength of the laser stripe in this direction corresponds to the Gaussian distribution with respect to the left and right symmetry of the laser line center of gravity. The Gaussian curve is used for fitting in this paper, and the peak of the fitting curve is obtained as the centerline coordinate value of the coarse extraction. As can be seen from the peak extraction, the coordinates of the centerline have reached the sub-pixel level. Because of the flat top phenomenon due to the saturation of the grayscale, a degree of error in the information of curve fitting is caused by the saturation points, and the curve information reflected by the grayscale value cannot be fitted accurately. The flat roof phenomenon is due to the laser stripes projected by the laser emitter on the target object brightness information beyond the light intensity reflected by the grayscale value (0-255), resulting in a continuous area of gray saturation (grayscale value 255) state. Therefore, the problem of extracting the center line of the supersaturated laser line is how to solve the influence of the supersaturation point on the gray intensity information. For the center line of the supersaturated laser line, the flat top phenomenon of the laser line is eliminated by using the smoothing method shown in Figure 8. Then, the Gaussian curve is used to fit the peak position of the exit curve, which is the center point coordinates. As shown in Figure 8, the original sampling points are saturated with multiple grayscale values, and the grayscale values are unevenly distributed. There are singular points that deviate from the fitting curve, which results in a large deviation by Gaussian curve fitting. As the blue box pixel dots shown in Figure 8, the saturation point of the grayscale value is eliminated by the Gaussian smoothing for the original data. After eliminating the flat top phenomenon, the Gaussian curve is used to fit out the gray curve spline and extract the peak position. As can be seen from the results of the two graphs, the grayscale value changes greatly after smoothing, and the defect spline is more consistent with the true value of the grayscale curve. Figure 7: The ceiling phenomenon and its curve fitting. Considering that the above curve fitting method has reached the sub-pixel level, there are still some deviations as the curve fitting does not fully utilize each grayscale value.