## 3 Measurement System Measures the Core Algorithm
### Image Preprocessing  
In the process of collecting cross-cutting board images, image quality is influenced by numerous factors. In addition to hardware factors such as cameras, lenses, and lighting used for image acquisition, adverse environmental conditions at the scene can also have a significant impact on cross-cutting board images. For example, factors such as light intensity and vibration can have a certain impact on the detection accuracy. For instance, excessive or insufficient light intensity can result in unclear image acquisition, and in severe cases, no image may be captured at all. Vibration of the on-site detection equipment directly affects the detection accuracy, which has been addressed in Section 2.2 by installing shock-absorbing dampers during device installation. The impact caused by light intensity needs to be resolved through image preprocessing. Therefore, image preprocessing is often an indispensable part in visual measurement, which can greatly eliminate the non-ideal information in the image and enhance the real feature effect of the image. Commonly used image preprocessing mainly includes image filtering and noise reduction, threshold segmentation, morphological processing, and so on [13; 14; 15]. (1) Median Filtering  
Median filtering is to cover the original image with a certain window shape according to a certain moving order, calculate the median value of all the pixels in the area, and use this value to represent the center pixel of the covered area. \[G(x,y)=med\{f(x-k,y-l,k,l\in W)\} \tag{6}\]  
The process of the filtering algorithm is simple and easy to implement with less effect on the image boundary, as shown in Figure 6.  
(2) Cross-cutting board feature extraction  
Image feature extraction is based on image gray level, shape, and other parameters; the image is divided into different sub-regions to remove unnecessary information and extract target features. The extracted image shows obvious differences between different regions, while the same feature shows a high degree of similarity. The automatic threshold segmentation algorithm is based on an image gray histogram to determine the gray threshold; no obvious difference in the background and the target gray has a good feature extraction effect under the condition [16]. In this paper, an adaptive threshold image feature extraction algorithm based on the maximum measure of inter-class variance is proposed. The adaptive threshold image feature extraction algorithm can effectively solve the impact caused by unstable on-site lighting intensity. It adjusts the system exposure according to changes in lighting intensity, thereby ensuring the clarity of captured images. If the image can be divided into target feature Y, background and other interference factors Z after automatic segmentation, then the distribution of pixel values of the same category should be uniform, and the distribution of pixel values between classes should be significantly different [17]. Researchers often use the variance to measure the homogeneity  
Figure 6: Comparison of image filtering. of class or differences; an optimal threshold can maximize the variance between target class A and background class B [18; 19]. The between-class variance \(\sigma^{2}(K)\) can be represented as follows:  
\[\sigma^{2}(K)=P_{A}(\mu_{A}-\mu)^{2}+P_{B}(\mu_{B}-\mu) \tag{7}\]  
In the equation, \(\sigma^{2}(K)\) is the between-class variance;  
\(K\) is the optimal threshold for maximizing variance;  
\(P_{A},\mu_{A},P_{B},\mu_{B}\) are the probabilities and means of the grayscale values appearing in two categories of pixels, A and B. \(\mu\) represents the average grayscale value of the overall image. \[\left\{ \begin{array}{l}P_{A}=\sum\limits_{i=1}^{K}P_{i}=P(K)\\ P_{B}=\sum\limits_{i=K+1}^{K}P_{i}=1-P(K)\end{array} \right. \tag{8}\]  
\[\left\{ \begin{array}{l}\mu_{A}=\frac{\sum\limits_{i=1}^{K}iP_{i}}{P_{A}}= \frac{\mu(K)}{P(K)}\\ \frac{\sum\limits_{i=K+1}^{M}iP_{i}}{P_{B}}=\frac{\mu-\mu(K)}{1-P(K)}\end{array} \right.