| With the development of electronic technology,the types and quantity of PCB are increasing,and the intensity of PCB detection task is also increasing.Compared with manual detection,PCB defect detection based on computer vision method is more suitable for this kind of high-intensity,long-time and high requirement operation.AOI is one of the main vision based PCB detection technologies.This paper mainly focuses on two aspects of AOI detection: in the acquisition of PCB information,aiming at the shortcomings of traditional methods,this paper proposes a tracking method based on video stream;In PCB detection,3D structure reconstruction is used to compensate the depth information of PCB.The main contents of this paper are as follows(1)PCB tracking based on video stream.Due to the regular motion of PCB in pipeline,this paper uses improved Kalman filter to track PCB.Firstly,the natural breakpoint method is used to learn 20 PCB images to obtain the initial threshold that can distinguish the background from the target.Secondly,the Kalman filter prediction equation is used to obtain the predicted position of the PCB,and the candidate region is calculated by the predicted position.Thirdly,the correlation graph between the candidate region and the target is calculated.Secondly,the non maximum suppression is used to process the correlation graph,Finally,the coordinates of PCB board are determined by Kalman filter correction equation.The tracking method based on video stream can make full use of the information of adjacent frames in PCB video and effectively reduce the calculation of background area.The experimental results show that the AOR of the tracking result and the standard position is 0.8968,the average tracking speed is 135 FPS,and the average loss rate is less than 0.02 by using the initial threshold calculated by the natural breakpoint method.(2)PCB 3D reconstruction based on monocular image sequence.Firstly,this paper uses monocular camera to capture PCB images.According to the difference between monocular sequence images and images captured by multi camera,monocular camera frame images are converted into binocular vision images.Secondly,the effects of three stereo matching methods are analyzed,and sgbm method is selected as the basic method of PCB 3D reconstruction.Thirdly,the sgbm method is improved.Firstly,the census feature,the gradient information in the horizontal direction and the cost calculated by BT method are used as the matching cost.Secondly,the canny edge information is used to guide the parallax aggregation.Finally,the improved parallax filling method is used to refine the parallax,and the Middlebury stereo dataset is used to detect the effect of the improved method,The error matching rate of the improved sgbm method is about 0.15 lower than that of the original method.Secondly,the improved sgbm method is used to realize the 3D reconstruction of PCB,and the reconstruction effect is displayed by PCL.Finally,the feasibility of 3D reconstruction in PCB component height detection,surface tilt detection and existence detection is analyzed and verified. |