## 1 Introduction
[PERSON] et al. [21] used an innovative calculation method based on the target angle to effectively improve the effect of laser intensity correction and 3D reconstruction. In order to eliminate the error caused by the deflection between the measured system and the co-construction, [PERSON] et al. [22] measured the weld by the height value based on the grid laser and the gray value of the gray photo to obtain the 3D contour. Aiming at the problem of low reconstruction accuracy of small objects, [PERSON] et al. [23] provided a fast and complete 3D reconstruction method based on a laser scanning and SMF algorithm, which improved the speed, accuracy, integrity, and visual effect of 3D modeling of small objects. However, the result of laser measurement is easily affected by noise as the laser line has a certain width, and the fuzzy contour line may lead to a deviation between the reconstructed result and the measured object. The laser centerline extraction has a very important influence on the accuracy of 3D establishment [24], and the extraction methods for objects with surface texture and reflective plane are relatively few [25]. [PERSON] et al. [26] applied a laser centerline extraction algorithm based on the Hesse matrix to laser scanning and built a high-speed and high-precision laser centerline extraction system. [PERSON] et al. [27] proposed a laser fringe center detection algorithm based on the gray barycenter, which has been proven to be characterized by good stability. [PERSON] et al. [28] used a breakpoint detection method of laser fringe center line based on fixed dynamic programming, which could effectively avoid the influence of noise and improve the calculation efficiency. [PERSON] et al. [29] used the contour polygon segmentation method to extract the laser centerline, and experiments showed that a more complete and smooth 3D model could be generated compared with other classical methods. [PERSON] et al. [30] applied a Voronoi diagram to laser fringe extraction and proposed a fast-pruning algorithm for the reconstruction of standard graphics, but there were large errors in the processing of noisy images. [PERSON] et al. [31] improved a grayscale barycenter method based on a normal vector to calculate the subpixel center of laser lines. Due to the large number of calculations required for hundreds of images, [PERSON] et al. [32] proposed a Zhang-Sun refinement algorithm to effectively preserve the data information of the laser fringe endpoints. When fitting the laser center line, a method of extracting the region of interest is proposed to improve the anti-interference ability of the algorithm, but the influence of the laser line width and gray value on the center line is not considered. Based on the above analysis of the references, a method for extracting the laser center line based on the improved grayscale center of gravity method is proposed in this work, which is applied to the 3D reconstruction of battery film defects. Firstly, a smoothing method is used to eliminate the flat top of the laser line, and the Gaussian curve is adopted to fit the peak position of the curve. Then, the gray threshold is set to automatically extract the laser linewidth, and based on the window opening, the grayscale center of gravity method is improved to extract the coordinates of the center pixel for the second time. Finally, the 3D model of surface defects on the lithium battery is reconstructed, and the experimental results show that the standard error of the proposed method is 0.005 pixels, which has a better extraction accuracy and noise resistance. The rest of this work is organized as follows. The principle of laser triangulation and the pretreatment method of images are introduced in Section 2. In Section 3, the improved laser extraction method is proposed. The superiority of the proposed method is verified by analyzing the accuracy, noise resistance, and reconstruction effect of the method in Section 4. Conclusions and future works are summarized in Section 5.