Abstract:To address the limitations of traditional vision-based methods in measuring the full dimensions of different workpieces, this paper proposes an online full-dimension inspection method for workpieces based on shape matching. The method inputs the target workpiece image into an improved Superpoint keypoint detection network to obtain all keypoints, which are then used to describe the workpiece contour. Then, the keypoint template and the keypoints of the target workpiece are fed into a point rendering layer. An enhanced Superglue feature matching algorithm with augmented keypoint location information is employed to achieve full matching, extracting keypoints that match the template points and measuring the distances between keypoints, thereby enabling full-dimension measurement of the workpiece. To validate the effectiveness of the proposed method, experiments were conducted, including gauge block size detection, calibration plate size detection, and electrochemical cell size detection. The experimental results indicate that for the size measurement experiment of a 25 mm Grade 0 gauge block (with an accuracy better than ±0.14 μm), the maximum deviation of the system’s ten repeated measurements was ±0.02 mm, and the standard deviation was 0.01 mm, demonstrating that the system has high repeatability accuracy. For the checkerboard calibration plate, the size measurement error does not exceed ±0.03 mm, verifying the feasibility of the proposed method. In the dimensional measurement experiment of primary batteries, the AAA battery size inspection had an error range of ±0.03 mm with an average processing time of 0.08 s, while the AA battery inspection showed an error of ±0.03 mm with an average time of 0.09 s. Both meet the enterprise’s production line requirements for online inspection, which demand ±0.05 mm accuracy and real-time detection within 0.1 s. Unlike traditional algorithms that require specific detection methods for different workpieces, the proposed approach exhibits strong adaptability to diverse dimensional detection requirements and is highly applicable for online full-size inspection of parts in industrial settings.