## 1 Introduction
Dimensional error detection plays a critical role in ensuring the quality of certified goods during the production and processing of locks. While surface flaws are commonly addressed in defect identification, it is important to consider other dimensions as well. The size of the lock core bead hole, for instance, is a crucial dimension that directly impacts the lock's quality. Manual measurement of this dimension is labor-intensive and time-consuming. As vision technology continues to advance, the use of machine vision measurement is becoming increasingly prevalent in industrial applications due to its high accuracy, speed, and automation capabilities. A method for binocular online binocular stereo vision detection of rubber extrusions was put out by [PERSON] et al. [14], and the measurement uncertainty was kept to a maximum of 0.1 mm. In the study conducted by [PERSON] et al. [15], the utilization of a temporally encoded structured light system was explored as a means to achieve precise 3D measurements. This method offers the potential to achieve an accuracy of approximately 0.3 mm, providing reliable and detailed dimensional information. [PERSON] et al. [16] developed a new automatic measurement system. The system has a measurement range of 1500 \(\times\) 200 \(\times\) 4000 mm and limits the uncertainty to within 1 mm. To achieve high-precision measurement of the dimensions of massive vehicle brake pads, [PERSON] et al. [17] proposed a measurement method based on a dual-camera machine vision system and a relative measurement principle. [PERSON] et al. [18] proposed a method for performing coarse edge detection of workpiece images using the Holistic Nested Edge Detection (HED) model. The effectiveness of this method was validated using a shaft workpiece as an example, demonstrating its applicability in practical scenarios. A machine vision-based online measurement method for the dimensional accuracy of cone-spinning workpieces was proposed by [PERSON] et al. [19]. The method can obtain a clean profile for a conical spinning workpiece. A high accuracy, well-stabilized machine vision-based straightness measurement system for 1500 mm long seamless steel pipes was developed by [PERSON] et al. [20]. In order to enhance the image quality of thermal parts, [PERSON] et al. [21] primarily introduced a spectral selection method. This method significantly enhances the hot spot appearance. [PERSON] et al. [22] aimed at the rapid non-contact measurement problem of a revolving workpiece's radial and axial dimensions, a fast and high-precision visual inspection method has been presented in this paper. [PERSON] et al. [23] introduced a non-contact strip deviation online measurement method that relies on image detection and machine vision technology. This method offers the flexibility to adapt to varying strip heights, allowing for easy modifications. By utilizing this approach, accurate measurements of strip deviation can be obtained without the need for physical contact with the strip. In high-mix, variable-volume production systems, [PERSON] et al. [24] proposed a method for transferring the workpiece position and orientation across machine tools as an example of its use. A visual measurement system was established for determining ring size by [PERSON] et al. [25]. [PERSON] et al. [26] proposed a unique monocular vision measurement method for the non-horizontal target to solve the difficulty of the multi-equipment measurement methods and the limitation of the monocular measurement methods for horizontal targets. Using machine vision, [PERSON] et al. [27] suggested a technique for calculating the straightness, roundness, and cylindricity of a workpiece. This method will offer a workable industrial remedy for determining workpiece shape deviation. [PERSON] et al. [28] introduced a contour segment combination algorithm based on a clustering search approach and rotation direction determination.