Purpose – This paper aims to propose image stitching by reduction of full line and taking line image as registration image to solve the problem of automatic optic inspection in PCB detection. In addition, surf registration was introduced for image stitching to improve the accuracy and speed of stitching. Design/methodology/approach – First, image stitching proceeded by method of full line reduction and taking line image as registration image; second, surf registration was introduced based on the traditional PCB image stitching algorithm. Scale space of the image pyramid was adopted for confirming relative future points between stitching image. The registration means of nearest neighbourhood and next neatest neighborhood was selected for feature matching and fused in region of interest to fulfil image stitching. Findings – The improved stitching algorithm with small data size of image, high speed and noncumulative transitive error eliminated displacement deviation and solved the stitching gap caused by uneven illumination, to greatly improve the accuracy and speed of stitching. Research limitations/implications – The research of this paper can only used for appearance detection and cannot be used for solder joint inspection with circuit detection or invisible solder joint detection; it can identify and mark PCB component defects but cannot classify automatically, thus artificial confirmation and processing is needed. Originality/value – Based on the traditional image stitching means, this paper proposed full line reduction for image stitching, which reduces processing of data and speeds up image stitching; in addition, surf registration was introduced into the study of PCB stitching algorithm, which greatly improves the accuracy and speed of stitching and solves stitching gap formed by opposite variation trend of image local edge caused by uneven illumination.