| As one of the commonly used items in daily life,metal workpieces are widely used.Therefore,it needs to be tested to ensure the quality.Geometric measurement is a common detection method,which is used to judge whether the standard is met by measuring the appearance size of the metal workpiece.Traditional methods mainly use physical tools such as rulers,micrometers,vernier calipers,etc.,which have limited measurement range,low efficiency and cannot guarantee accuracy,and the measurement results are easily affected by subjective factors.For actual production,manual measurement cannot meet the measurement requirements of large batches,high strength and high precision.With the development of computer science technology and image processing technology,recognition and detection methods based on machine vision are becoming more and more common.It can realize the non-contact and real-time automatic detection and judgment of the measurement target,and has the characteristics of high efficiency,high precision,objective repeatability,and automation.Aiming at the shortcomings of the existing measurement methods,this paper takes the circular and polygonal metals as the research objects,and discusses the research methods of visual measurement with high precision and high stability.Firstly,the key technologies of measurement are analyzed according to the detection requirements,and the overall measurement process is designed according to the characteristics of the research object,and the appropriate light source,camera and lens are selected to build an image acquisition hardware platform.In order to improve the measurement accuracy,starting from the principle of object imaging,the causes of image distortion are discussed,and finally the camera is calibrated.In the research of image preprocessing method,the legitimacy of the image is judged,invalid images are removed,and the algorithm efficiency is improved.For multi-target detection,in order to improve the positioning accuracy,an image normalization method based on Maximally Stable Extremal Regions(MSER)is proposed.In order to eliminate the influence of illumination,a piecewise linear grayscale enhancement method is used.Dynamic adaptive threshold segmentation.The edge detection method is studied,starting from the traditional edge detection algorithm,through the experimental analysis of the existing deficiencies,the edge detection method of the caliper tool based on the improved Canny operator is proposed,and the stable and accurate edge is obtained.In order to realize intelligent measurement,classify and automatically identify contours,a contour segmentation algorithm based on Ramer algorithm is proposed,which divides the original contour into basic measurement units of straight lines,circles and arcs.At the same time,the detection of straight lines and circles based on Hough transform,the curve fitting method of traditional least squares method are discussed,and finally the curve fitting method based on Tukey weight is adopted to achieve high-precision fitting.Finally,integrate the research methods,design a set of automatic geometric dimension measurement algorithm,realize the measurement of geometric parameters circle diameter,roundness,straight line length,straight line angle,and verify the measurement results and analyze the measurement errors by comparing with the experimental group.It is concluded that the whole algorithm can intelligently identify and measure metal workpieces,and the circular diameter measurement accuracy is within 0.03 mm,and the linear measurement accuracy is about 0.15 mm,which satisfies the detection accuracy. |