## 4 Results
### Size Measurement Experiments  
1. Size conversion. In this paper, a total of 64 pictures of the lock cylinder were captured, with five bead holes present in each picture. This amounts to a total of 320 lock core bead hole pictures after the extraction of the Region of Interest (ROI). Section 3 of the paper describes the process of obtaining the fitting circle radius for the lock cylinder's bead hole. However, it should be noted that the calculated radius is in terms of pixels, and thus requires a size conversion to verify the accuracy of the algorithm. Equation (20) is provided in the article to facilitate this size conversion. \[k=\frac{\sum_{i=1}^{n}\frac{d_{r}}{d_{pixel}}}{n}\] (20)  
In the formula mentioned, the variable \"\(n\)\" represents the number of measurements conducted on the standard workpiece, \"\(d_{r}\)\" represents the actual measurement size, and \"\(d_{pixel}\)\" represents the diameter of the fitted circle obtained through sub-pixel edge detection measured in pixels. The variable \"\(k\)\" represents the average pixel equivalent, indicating the actual size and length represented by each pixel in the experimental environment, measured in mm/pixel. In this paper, a vernier caliper with an accuracy of 0.02 mm is used for measurements. The diameter of the standard qualified lock cylinder bead hole is measured using this vernier caliper, yielding a value of 3 mm. A total of 45 measurements are performed on the standard workpiece using the vernier caliper. By calculating the pixel equivalents for these measurements and determining their average, the average pixel equivalent is found to be 0.013282 mm/pixel. 2. Size calculation. The measurement size can be calculated from equation after computing the average pixel equivalent (21). The 320 measurement data groups were separated into 6 groups, and Table 6 contains the average values of the calculated results for each group. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Group**} & **Number of** & **Fitting Circle** & **Real** & **Predictive** & **Mean** \\  & **Samples** & **Diameter/(Pixel)** & **Value/(mm)** & **Value/(mm)** & **Absolute** \\  & & & & & **Error/(mm)** \\ \hline
1 & 45 & 225.891 & 3.00 & 3.001 & 0.027 \\
2 & 50 & 227.495 & 3.00 & 3.022 & 0.023 \\
3 & 60 & 227.611 & 3.04 & 3.024 & 0.019 \\
4 & 50 & 227.246 & 3.04 & 3.019 & 0.023 \\
5 & 50 & 225.031 & 2.98 & 2.989 & 0.028 \\
6 & 65 & 222.217 & 2.98 & 2.952 & 0.028 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Calculation result record. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Version** & **mAP** & **Weight Size** & **Training Time** & **Average Inference Time** \\ \hline YOLOv5 & 0.900 & 13.8 MB & 10 h & 15.31 ms \\ YOLOv6 & 0.911 & 36.2 MB & 16 h & 10.29 ms \\ YOLOv7 & 0.915 & 71.4 MB & 8 h & 11.23 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of the detection effects of YOLO algorithms. Table 6 shows that the average measurement error of the measurement algorithm proposed in this paper for the six groups of measurement data is all within 0.03 mm. The measurement duration for each ROI lock cylinder bead hole area is 20.54 ms on average. Figure 13 displays three shapes of the object: a triangular prism, a quadrangular prism, and a nut. The triangular prism has an equilateral triangle base with a width of 5.06 mm and a side length of 5.84 mm. The quadrangular prism has a side length of 5.02 mm, and the nut is a standard part of the model GB_FASTENER_NUT_SN AB1 M4-N. The size of the nut was measured using a Vernier caliper, resulting in a width of 6.88 mm and a length of 7.76 mm. Both the triangular prism and the quadrangular prism were fabricated using a 3D printer with a printing accuracy of 0.1 mm, and their sizes were measured using the proposed algorithm in this paper. Thirty sets of data were measured for each of the three shapes, and the average values were calculated and shown in Table 7. The results in Table 7 demonstrate that the proposed algorithm can measure the size of different shapes with high accuracy.