## 2 Construction of Dimensional Feature Images
### Definition of Dimension  
In the theoretical model, when the optical axis is perpendicular to the test surface, the imaging system can avoid perspective distortion, aligning the projection with the actual proportions of the object to obtain true values. However, in practical applications, due to inherent optical defects in the lens, such as barrel and pincushion distortions, the imaging results may still exhibit certain degrees of distortion, as shown in Figure 1.  
This type of distortion is determined by the design and manufacturing process of the lens and cannot be completely eliminated through geometric adjustments that make the optical axis perpendicular to the object surface. Figure 2 shows a schematic diagram of the radial distortion offset of points at different distances from the optical center after passing through the lens. It can be seen that the further from the optical center, the greater the displacement, indicating greater distortion. Near the optical center, there is almost no offset. Therefore, even if the optical axis is perpendicular in actual measurements, it is still necessary to correct imaging errors using lens distortion correction algorithms or calibration techniques to get as close as possible to the theoretical true values. In recent years, many scholars have conducted in-depth studies on the issue of lens distortion correction and have proposed various methods to reduce imaging errors caused by optical defects. Among these, the lens calibration method based on calibration plates proposed by [PERSON] has received widespread attention. Using [PERSON]'s black-and-white checkerboard grid calibration method, the camera's intrinsic and extrinsic parameter matrices and the lens distortion coefficients can be obtained. This method involves taking images of a black-and-white checkerboard grid from multiple viewpoints, which allows for the precise calculation of the camera's intrinsic matrix (including focal length and principal point position) and extrinsic matrix (the camera's position and orientation relative to the world coordinate system), and corrects for radial and tangential distortions during the imaging process. However, [PERSON]'s lens calibration method also has its limitations. Firstly, although it can significantly reduce the errors caused by lens distortion, the correction results are still based on an approximate model and cannot completely eliminate errors, especially under complex lens distortion conditions or limited calibration settings. Secondly, when processing high-resolution images, the method requires geometric correction and transformation for every pixel in the image, which involves a huge amount of compu  
Figure 1: Schematic diagram of image distortion. (**a**) Pincushion distortion; (**b**) barrel distortion. tation and can lead to a decrease in efficiency, especially in scenarios requiring real-time performance, which may become a bottleneck. To address the above issues, we propose a new method to enhance efficiency and accuracy. First, images are captured, and the optical axis center of the lens is calculated using a calibration method. Next, the images are appropriately scaled to reduce data volume and improve computational efficiency. In the scaled images, a target detection algorithm is employed to quickly locate the position of the workpiece and calculate its centroid coordinates. Subsequently, the centroid coordinates are mapped back to the original image to determine the precise position of the workpiece within the original image. Finally, the camera position is adjusted to align the workpiece's centroid with the optical axis center of the lens, achieving precise alignment.