| Laser marking technology is the most widely used technology in the field of laser processing in addition to laser cutting technology.During the use of the laser marking machine,it is necessary to manually use fixture to position the workpiece and manual quality inspection.Manual positioning and quality inspection have disadvantages such as high labor intensity,high cost and product quality is greatly affected by personal subjective influence.With the increasing application of machine vision technology in industrial production,the use of machine vision technology instead of artificial vision for positioning and quality inspection can effectively improve production efficiency and product quality.This thesis briefly introduces the machine vision technology and laser marking technology,and analyzes the current status of machine vision positioning technology and character defect detection technology at home and abroad.According to the actual application requirements,the system hardware and software are designed and selected.The camera is tilted considering the influence of the workpiece thickness on the image processing work under the tilt angle of the camera,it is proposed to avoid the influence of the workpiece thickness in the image processing process by selecting the shape of the light source and the arrangement position of the light source,and to expand the use range of the marking machine.The image correction algorithm in image processing technology is studied and analyzed.Considering that the imaging near the camera is large and the imaging away from the camera is small,the imaging is distorted,which hinders the positioning and quality inspection of the workpiece.Based on the commonly used image processing algorithm,an improved vanishing point perspective correction algorithm is proposed by combining the vanishing point perspective correction algorithm with the image perspective transformation matrix.After correcting the images collected by the camera,the camera is calibrated according to the characteristics of laser marking processing,and the polynomial-based distortion correction model is selected to correct the lens distortion.The position and rotation angle of the workpiece to be processed relative to the template workpiece are obtained through contour-based template matching.Combined with the characteristics of the template matching algorithm,the coordinates of the marking point of the workpiece to be processed in the galvanometer coordinate system of the marking machine are calculated.Select a reasonable scheme to extract the quality detection area and use the region growing method to process the background color area.Use template matching to detect misalignment and skew defects;then use image subtraction method to detect marking content stroke defects and dirt on the basis of template matching and mark them through connected domain analysis;finally propose to detect marking power defects through gray histogram.The experiment is carried out after the system hardware and software are built.Experiments show that the workpiece thickness hiding method and image correction method proposed in this thesis can effectively avoid the influence of workpiece thickness on image processing and correct the tilt angle image to a vertical angle image.The program can achieve higher calibration accuracy,faster marking positioning and quality detection functions,and more accurate identification of defective workpieces. |