Abstract:Aiming at the problem that Shi Ying glass ring is easily influenced by reflection and low contrast interference in industrial inspection, a method for measuring the inner and outer diameters of Shi Ying glass ring based on improved Canny algorithm is proposed. The image of Shi Ying glass ring is obtained by low-angle imaging and high-angle uniform illumination, and the image is preprocessed by bilateral filtering to suppress noise and retain edge contour feature information. The improved Canny algorithm, which combines adaptive smoothing filtering, multi-directional gradient calculation and Otsu adaptive threshold optimization, improves the accuracy of Shi Ying glass ring contour features, and establishes the measurement model of Shi Ying glass ring inner and outer diameters by least square fitting method. The experimental results show that the measurement error of the inner and outer diameters of common Shi Ying glass rings by this method is less than ±0.05 mm, and it has higher stability compared with manual measurement, and the measurement efficiency is significantly improved compared with traditional manual contact measurement.