In the visual inspection systems of PCB line detection, a good preprocess effect of test image is the precondition of the system with fine performance, while the its speed is the determinant of the real-time inspection performance. This paper proposed a preprocess algorithms of PCB test image, which includes two parts-binarization and denoising. The experiment shows that the preprocess algorithm is able to obtain an effective threshold for the binarization of the defect image, eliminating the noise and enhancing the speed highly.