In order to accurately detect the lines in the printed circuit board(PCB) photoelectric image with noise and illegibility,a novel method combining the random Hough transform with the least square fitting is proposed and realized.Firstly,the preprocessing of PCB photoelectric image with lines is made,and the error threshold is given.Secondly,the approximate positions of lines in the detected image are roughly by random Hough transform,the disturbance points and noise far away from the lines are deleted,the p...