## 1 Introduction  
For a long time, detecting and measuring the quality of hole parts, especially inner surface defects, have been a challenging issue for enterprises [1]. Based on principles, detection methods for inner surface defects can be divided into three categories: contact-based detection [2; 3], acousto-optic electro-thermal magnetic detection [4; 5; 6; 7; 8] and visual image-based detection [9; 10; 11]. From an efficiency and cost perspective, visual image-based detection will be the primary direction for future development. Endoscopes have been widely used in medical and industrial detection due to their ability to extend vision and expand visual range. When using the endoscope to detect the inner surface defects of a hole, the actual inner surface is parallel to the main optical axis of the lens and presents as a circular scattering distribution on the imaging plane, which hinders identification of the contour and size of these defects. Figure 1 shows the inner surface of the hole captured by the endoscope, with (a) representing a \(\varphi\)18 mm hole part with four grooves on the inner wall, (b) depicting the inner surface of the M20 thread, and (c) displaying an endoscopic image of a \(\varphi\)20 mm hole with a square transparent calibration plate attached to its inner wall. As seen in Figure 1, the distortion of each pixel in the image is primarily influenced by its distance from the image center. Taking Figure 1c as an example, circular spots of the same size are imaged as ellipses with different shapes, and the rectangular outline of the calibration board is imaged as a part of a circular ring. In order to realize the measurement and detection of hole internal surface defects based on endoscopic images, the distortion correction of endoscopic images has become a difficult problem that must be overcome. The structure of the endoscopic imaging system results in varying degrees of pixel distortion at different positions within the endoscopic image. The key to measuring surface defects on a hole is to correct this distortion in the image. The distortion correction methods for endoscopic images can be divided into calibration-based and projection-based corrections, depending on whether calibration is required. The calibration-based correction method obtains the lens parameters and corrects the imaging results by using a calibration board, such as a chessboard or dot matrix. For example, [PERSON] [12] calculated the internal and external camera parameters based on multiple images of the same target from different angles and the imaging principle in an inverse manner; [PERSON] [13] proposed a non-iterative method that can simultaneously obtain distortion function and camera parameters through multiple images with varying angles. However, it is difficult to ensure the consistency between the calibration environment and the application environment, making it impossible to obtain accurate calibration and measurement results. The correction method for projection transformation involves establishing a mathematical model based on the principle of perspective projection and restoring distorted image to a projected image that conforms to human visual habits. [PERSON] [14] and [PERSON] [15] established a polynomial mathematical model to reflect the nonlinear distortion of the endoscopic image, obtaining polynomial parameters by fitting pixel coordinate data while ignoring high-order terms. Building upon [PERSON]'s work, [PERSON] [16] uses the least squares method to obtain parameters of the polynomial model; [PERSON] [17] established a distortion model using the difference method and iteratively obtained its parameters through nonlinear search technology. In the aforementioned literature, polynomial expressions are used to describe the distortion of endoscopic images. While the correction effect is good, it requires significant resources, and errors in the algorithm increase rapidly as pixels move away from the image center.