| As the most commonly used sealing device on automotive engines,the O-ring plays a very important role in the airtightness of the engine.O-ring not only has good sealing performance,easy to install and use,but also has the advantages of simple structure,low cost,etc.The quality of its good or bad also directly affects the normal work of the engine.Therefore,how to guarantee the quality of the O-ring factory is very important.In China,there are currently thousands of O-ring manufacturers,but most small and medium-sized manufacturers in the O-ring quality inspection is still stuck in manual testing.When faced with large-scale testing needs,not only is it time-consuming and labour-intensive,but as it is a contact measurement,the testing accuracy is not high and can be affected by the subjective factors of the quality inspector.Because of the problems in O-ring quality inspection in China,this paper investigates the O-ring quality inspection method based on machine vision.The method mainly includes the O-ring outer diameter and wire diameter dimensional measurement method and O-ring surface burr defect detection method.In terms of dimensional measurement,as the current O-ring dimensional measurement algorithm based on machine vision is mainly a whole pixel-level algorithm,it has the disadvantage of low measurement accuracy.To improve the stability and accuracy of O-ring dimensional measurement,this paper proposes a sub-pixel edge detection algorithm based on cubic spline interpolation for O-ring dimensional measurement.In the image pre-processing process of the O-ring,adaptive median filtering is used to smooth the image and the Otsu algorithm is used to adaptively determine the threshold value for image binarisation.In the process of O-ring edge extraction,four classical integer pixel edge detection algorithms were compared with the noise-resistant mathematical morphology method in this paper,and the noise-resistant mathematical morphology was chosen to extract the edges of the O-ring.The outer and outer diameters and the size of the wire diameter are obtained using least squares.The distance from the centre of the circle to the edge contour point is compared with the inner and outer circle radius obtained by the dimensional detection algorithm,and a threshold is set to determine whether the O-ring has a burr at the edge.The experimental section of this paper presents camera and pixel calibration experiments,comparison experiments of three-dimensional measurement algorithms and edge burr detection experiments.In the comparison experiments with the classical integer pixel edge algorithm,the experimental data shows that the mean square error of the outside diameter of this algorithm is 0.00480 mm and the mean square error of the line diameter is 0.00018 mm.The outside diameter error is kept within ±0.1 mm and the line diameter error can be kept within ±0.015 mm.Compared to the whole pixel algorithm,the measurement accuracy has been greatly improved.In the experiments on O-ring edge burr defect recognition,the burr recognition success rate reached 90.83%,meeting the design requirements of the algorithm. |