# Calibration and Image Reconstruction in a Spot Scanning Detection System for Surface Defects
## 5 Conclusions  
A spot scanning surface defect evaluation system, which has better performances on the detection for small defects and defect classification than the traditional systems, is established. However, subject to the existing deviations, the system cannot directly provide a high-quality defect image. This paper develops research on these system deviations and then establishes the mathematical model of the practical scanning trace. On this basis, a system calibration method based on straightness and scale constraints is proposed. This method employs a calibration plate with specific defect patterns as the test sample, and places particular straightness constraints and scale constraints on the defects after being extracted. By minimizing the constraints, one can obtain the optimal estimate of the system deviations, which is used, on the one hand, to adjust the system for eliminating the position deviation of the initial illuminated spot, and on the other hand, to establish an accurate mapping relationship for reducing the distortion of the reconstructed image. The adjusted system can perform the detection for the whole optical surface in a normal way but without any missing area at the center. Additionally, an image reconstruction method based on weighted average, capable of eliminating no-value pixels and suppressing signal noise, is proposed, thus enhancing the quality of the reconstructed defect image. Finally, experiments demonstrate the effectiveness of the proposed methods, with the results that the maximum straightness error is within 1.8 pixels and the scale error is within 0.7 pixels. Our methods provide the defect image data with high quality and high precision for the following image processing to extract defects, and hence lay the foundation for improving the detection accuracy of the system. The research results of this paper can also be applied to similar problems of other detection systems based on spot scanning, such as those for wafers, films, and rough surfaces. In the future, more constraints will be considered to improve the accuracy of the system calibration method. Our system can be further improved in two ways: (1) The raw data acquired by the system contains higher-resolution information, which can be utilized to improve the detection accuracy. (2) Collecting and detecting the specular reflection light can provide additional potentials to system adjustment and defect detection.  
Conceptualization, Y.Y., P.C., and F.W.; methodology, F.W.; software, Y.D.; validation, F.W., P.C. and H.H.; formal analysis, F.W.; investigation, Y.D.; resources, P.C.; data curation, H.H.; writing--original draft preparation, F.W.; writing--review and editing, Y.Y.; visualization, P.C.; supervision, Y.Y.; project administration, P.C.; funding acquisition, Y.Y. All authors have read and agreed to the published version of the manuscript.  
Figure 9: Gray value distributions in a background area near the center (upper row) and a background area far from the center (lower row) of the reconstructed images with different methods: (**a**,**c**) The proposed image reconstruction method; (**b**,**d**) The nearest-neighbor interpolation method.  
**Funding:** This research was supported by National Natural Science Foundation of China (NSFC, grant numbers 61627825, 61875173) and the State Key Laboratory of Modern Optical Instrumentation of Zhejiang University.  
**Conflicts of Interest:** The authors declare no conflict of interest.