| According to the image of the workpiece(that is,the image formed by the shadow),the workpiece type recognition and size measurement have a wide range of applications in the fields of workpiece qualification detection and workpiece size measurement.However,due to the influence of factors such as workpiece pollution interference,light source illumination changes,and different sizes of workpieces in the industrial environment,the accuracy of workpiece type recognition is low,the recognition is missed,and there are many false edges when the workpiece edge is extracted.In addition,rapid and accurate identification of workpiece types and high-precision detection of workpiece edges can better meet actual needs.This paper studies the application of target recognition algorithms and edge detection algorithms in the field of workpiece image measurement.The specific research contents are as follows:1.Aiming at the problems of missed and wrong detection and slow recognition speed of target recognition algorithm when the light intensity changes and the workpiece size changes,an improved TinyYOLOv3 workpiece type recognition is proposed.method.First,add a residual network structure to the TinyYOLOv3 network,so as to extract as much image feature information as possible,and add a network prediction scale on the basis of the original two-scale prediction to form a three-scale prediction;secondly,the position error in the loss function The calculation of the items is optimized to make it closer to the real situation;finally,the collected workpiece image data sets are clustered by improving the K-means clustering algorithm to obtain a more appropriate a priori frame size.The simulation experiment results show that compared with the traditional TinyYOLOv3 algorithm,the detection accuracy of the improved TinyYOLOv3 algorithm is increased by 2.56%,and the recall rate is increased by 2.88%.Compared with the YOLOv3 algorithm,although the accuracy rate and the recall rate are slightly reduced,The detection speed is 2.15 times that of YOLOv3.In addition,the algorithm in this chapter can well complete the recognition of the workpiece type under a variety of intensities of light.2.Aiming at the problems of reduced edge positioning accuracy and detection of a large number of false edges caused by the change of light source illumination intensity and workpiece pollution interference,an improved Canny algorithm is proposed to detect the edge of workpiece image measurement.The algorithm first replaces Gaussian filtering with switch median filtering to achieve denoising while keeping the gray value of non-noise pixels unchanged,thereby improving the edge positioning accuracy;using K-means clustering algorithm to cluster gradient images to obtain the height Gradient value clustering center,use the maximum between-class variance algorithm to process the gradient image to obtain the maximum gradient between-class variance threshold,and then combine the high and low gradient value clustering center with the maximum between-class variance threshold,so as to realize the self-adaptation of the high and low threshold;A large number of interference edges in the image of the workpiece are removed by the method of area morphology.The simulation experiment results show that the improved algorithm has an edge detection accuracy of less than 1 μm,and has the advantages of strong threshold adaptive ability and good interference removal effect.In order to apply the workpiece identification and measurement method to the actual industrial production,this paper designs an image-based workpiece identification and measurement system.The system consists of a workpiece image input module,a workpiece type recognition module,an edge detection module and a size measurement module.The simulation experiment of each module shows that the system has the functions of workpiece type recognition,workpiece edge detection and workpiece size measurement. |