In this paper, a novel algorithm is proposed to detect linear edge. Image gradient is acquired by Sobel or Prewitt filters. Logical addition is applied to enhance image contrast. Statistical method is employed to cope with gradient data—gradient projection in the horizontal and vertical direction to compute the average gradient value. Multi-level B-Spline interpolation is employed to smooth gradient data. At last, edge coordinates can be computed precisely by the number and interval of extreme points. The experiment results are presented to show validity of the algorithm, which precision and accuracy can reach to sub-pixel. The proposed approach puts merits of zero crossing method and threshold method together, which is very robust, convenient and efficient to detect linear edge in industrial environment.