## 2 Approach Description
### Image Processing  
Based on the optical path designed above, this section will specifically describe how image processing is performed when the CCD receives the laser signal, and how to set the white pixel threshold for adjusting the actual measured value. The device determines whether the probe enters the hole or protrudes out of the hole by acquiring the laser signal reflected back from the hole wall. After the laser signal is acquired by the CCD, it is imaged as a red spot by red-green-blue (RGB) colour model [23]. Since the CCD acquires optical signals for all external environments, there are laser signals and interference light signals from the external environment in the original image. Therefore, the ultimate goal of image processing is to identify the presence or absence of a red laser signal from the original image. Figure 3 shows the block diagram of imaging identification and screening process. As shown in Figure 3, when the laser signal is projected onto the hole wall, the CCD receives the reflected laser signal and transmits the single frame image to the host computer for real-time processing [24]. Next, the image colour model needs to be transformed from RGB to hue-saturation-value (HSV). After that, we set the parameters of HSV model image to screen the laser wavelength produced by the laser transmitter. In order to facilitate calculation of the selected laser spot imaging, the image needs to be processed in two values. There are only white and black pixels in the binary image, and the white pixels represent the laser signal reflected by the hole wall. When white pixels are generated, this means that the laser signal is projected onto the wall of the hole to be measured. The host computer outputs a signal to the microcontroller unit (MCU) to show that the front end of the probe has entered the hole. In order to make the whole device have high fault tolerance and adaptability, it is necessary to set a threshold for the number of white pixels, which decides whether to send signals to MCU or not. A digital image is composed of a number of pixels, and each pixel has its internal display principle, which includes parameters such as brightness and colour. Therefore, the colour composition and expression of the pixel form the colour model. The visible spectrum contains all the visible light subsets, each of which contains colour light for each wavelength of the visible spectral range to which this subset belongs. Different combinations of these visible light subsets form different image colours, and different colour models have different colour expressions. Figure 2: Optical path design of the measuring system. The RGB colour model contains red, green, and blue colours, and the different ratios of the three colours blend other colours [25]. Since the colour expression method is the same as the colour formation principle of the actual display device, most of the display device and the imaging device adopt the RGB image colour model, and the image colour model directly extracted by the device designed in this paper is the RGB colour model. The HSV colour model is composed of Saturation, Hue, and Value. Compared with the RGB colour model, HSV colour model is more in line with the human eye's recognition and computer processing of images. The HSV colour model explains the origin of colour and conforms to the physical principle [26]. Therefore, in image processing, the RGB colour model needs to first be transformed into an HSV colour model. The RGB colour model is expressed using a three-dimensional rectangular coordinate system, and the three parameters of R, G and B correspond to X, Z and Y axes, respectively. The HSV colour model is expressed in a three-dimensional polar coordinate system. Hue, Saturation and Value correspond to Z axis, polar axis and rotation angle, respectively [27]. Therefore, the conversion between the two colour models is calculated as follows:  
Hue calculation:  
\[\mathrm{H}=\left\{