| Printed Circuit Board(PCB)is an insulating substrate made by electronic printing for electrical conduction,which greatly reduces the number of wires connected by components and occupies an important position in the electronic industry.The welding of PCB components has also become a decisive link in the field of industrial production.At present,the welding methods of through-hole components can be divided into manual welding and machine welding.Manual welding consumes manpower,material resources and time cost,and is often disturbed by operator’s experience,knowledge and personal emotions.At present,the teaching programming adopted by tin welding robots is a semi-automatic welding method,in which the main control unit drives the welding joint to complete the welding after inputting the coordinates of the welding joint,and the cost of equipment and maintenance is high.In order to solve these problems,this paper studies the detection and positioning of weld holes in through-hole components.Compared with manual input of coordinate points,the method based on machine vision and image processing will automatically detect the target position and transfer the positioning coordinates to the mechanical control unit.The whole process realizes automatic operation,which is more flexible and practical,and has important research significance.For a complex scene,image detection and recognition technology based on machine vision will be more stable,objective and accurate.Therefore,this paper uses machine vision algorithm to detect the welding position of components,extracts the key feature information of the target and locates the welding position accurately.The main research work of this paper is as follows:(1)Based on the software development platform of C++,Qt5.0 and Visual Studio 2013,a graphical interface for detecting and locating the welding position of through-hole elements is designed and implemented,which includes four modules: image acquisition,image processing,target detection and location,and result output.The stability and reliability of the software system is verified by experiments.It lays a good foundation for the research.(2)Analyzing PCB image features and grasping the entry point of detection,a set of image preprocessing process is designed,which mainly includes image denoising,color space conversion and image threshold segmentation.Common image segmentation algorithms are analyzed and studied.Finally,a PCB image threshold segmentation algorithm based on L-space histogram smoothing and fusion of the theory of maximum inter-class variance method is proposed.The image preprocessing lays a good foundation for the subsequent detection and location.(3)The existing algorithms of circle detection and localization are studied,and a multi-circle target detection method based on region combination shape feature screening and sub-pixel contour extraction is proposed,which is applied to the detection of circular through-hole pads.Through comparative analysis of experiments,the detection accuracy and positioning accuracy are calculated in detail,and the effectiveness of the algorithm is verified.(4)The method of locating welding position in the presence of component pins and PCB multi-layer packaging is studied.The fusion alignment of the template pad image and the pad detection result of the image to be inspected is skillfully made.After extracting the key features,the contrast difference image is obtained,which is used as the mapping of the welding position of the component pin. |