| Based on the Made in China 2025 plan to promote the transformation of manufacturing to intelligent manufacturing,intelligent manufacturing has become one of the major national strategies.Inspection technology is one of the key technologies of intelligent manufacturing,and vision inspection system is the core of inspection technology The detection system based on machine vision has a wide application prospect in the field of industrial detection because of its high precision,strong anti-interference,non-contact and other characteristics.In this paper,the sub-pixel edge detection algorithm adopted by the detection system is improved,which can improve the edge positioning accuracy under the premise of a certain camera resolution,save hardware costs,improve the traditional pixel edge detection algorithm technology,and provide a new technical means for machine vision detection.In this paper,a dimension feature detection system based on machine vision is designed,which takes round hole parts as the research object.Related image processing algorithms and size measurement methods are studied.The on-line measurement of dimension characteristics of different types and specifications of round hole parts is realized.The main contents are as follows:(1)Study the technical indicators of part size detection,design the hardware of the image acquisition system,determine the lighting scheme,and build the test platform of the detection system.The secondary development of the camera was carried out to realize the online detection of the system,the camera calibration method was studied to realize the conversion of pixel size and actual size,and the scheme design of the image processing algorithm flow was completed.(2)The image preprocessing method is studied based on the factors of improving the image quality and reducing the amount of arithmetic.In order to reduce the amount of data calculated by the subsequent algorithm and retain the necessary characteristic information,the image was first grayed.The two-dimensional and three-dimensional gray effect images processed by mean filter,median filter,Gaussian filter and anisotropic diffusion filter are studied and analyzed,and the anisotropic diffusion filter operator with the best effect of noise removal and edge preservation is selected for image filtering processing.The target region was completely segmenting from the background image based on the threshold segmentation algorithm combining the maximum inter-class variance method and the morphological closure operation.Finally,Canny edge detection operator is used to extract pixel level edge points in the target region,which is prepared for subsequent image processing.(3)A subpixel edge detection algorithm combining coarse and fine localization is proposed,based on the pixel-level edge points using the Zernike moment subpixel edge detection algorithm to achieve subpixel edge point localization.Deriving the principle of the Zernike moment algorithm,aiming at the problem that step gray threshold must be obtained by repeated tests when edge point is determined,an improved algorithm combining Otsu method to optimize step threshold is proposed.The improved algorithm and the traditional Zernike moment algorithm were used to extract the sub-pixel points from the simulation images respectively.By comparing the deviation of the coordinate values of the corresponding construction points,it was verified that the improved algorithm had a higher detection accuracy,and the center of the circle could reach the positioning accuracy of 0.01 pixel.The extracted sub-pixel edge points are fitted by the least square method,the contour circle feature is identified,and the part center distance and concentricity parameters are calculated.(4)Develop the interactive interface of online detection module by calling Open CV function library based on QT.The proposed algorithm was applied to extract the sub-pixel contour edge points from the inner circular holes of the parts,and the performance of the proposed algorithm in actual workpiece edge detection was verified.The system was used to measure the same circular hole part for 20 times,and the relative deviations of center distance and concentricity were all within 0.03 mm,which verified the stability of the system.Then,the dimensional characteristics of three kinds of circular hole parts with different specifications were tested.The detection accuracy all met the requirements of detection technical indicators within 0.015 mm,which verified the universality of the detection system for the correlation parameters of circular hole features of parts. |