| The detection and identification of workpieces and the measurement of parameter have always been a very active topic.In terms of parameter measurement,the traditional manual measurement technology can no longer meet the current high-speed development needs,and the visual measurement is a hot topic in the field of machine vision.Compared with traditional measurement methods,there are many advantages in image recognition and paramete r measurement by using machine vision technology.On the one hand,it can improve the detection efficiency and measurement accuracy.On the other hand,machine vision equipment can work steadily for a long time,which can save a lot of labor costs.In this paper,a series of image processing methods are used to measure the shape parameters of some workpiece with simple geometric shape.The research is mainly carried out from the following two aspects: one is to identify different types of workpiece image,the other is to measure its shape parameters.For the identification of workpiece images,a simple,convenient,and reliable method based on regional attribute characteristics is used.Firstly,preprocess the image,then use the Otsu algorithm to segment the image,then detected the edge of the workpiece image,inverte the binary image and fill holes.Finally judge the workpiece type acccording to the extracted connected area attributes.The measurement of workpiece shape parameters is mainly divided into th e following steps.Use the Hough transform to detect the straight line;track the boundary point of image,segment the edge of workpiece,fit the straight line and circle with the least square method,and calculate the actual size of workpiece with the result of camera calibration.The segmentation of the workpiece edge is to determine the dividing point between the segments first,and then group the edge points based on the principle of minimum distance with the dividing point as the boundary.Two effective methods are proposed for the determination of boundary points.One is based on the intersection points between adjacent lines after they are sorted;the other one is directly determined according to a certain search rule.In order to improve the fitting accuracy,the data points are optimized before the least squares fitting line.Specifically,the double-point removal method is used to remove the points with the largest positive and negative error in the original point set set until the number of remaining points reaches the original data point reservation ratio.After experimental verification,the recognition algorithm can quickly and accurately identify the type of workpiece,and its recognition accuracy rate is stable above 99.2%.At the same time,the measurement algorithm can accurately measure the shape parameters of the workpiece,and the measurement results basically meet the accuracy requirements.The average absolute error is basically stable within0.05 mm.The measurement uncertainty component i ntroduced by repeatability measurement is less than 0.01 mm.Secondly,the measurement speed is also close to real time.The experimental results show that the algorithm designed by the subject is an efficient and reliable algorithm. |