A new edge detection algorithm based on generalized B spline filter is proposed to extract image edge more effectively. First, generalized B spline is deduced from linear derivative equation. Based on generalized B spline, a difference template operator for edge detection is constructed, which inherits the scale factor of generalized B spline, and achieves different amplitude characteristic and band-pass property with different scale factor. Therefore, best edge result can be obtained by adjusting the scale. Thereafter, by combination with generalized B spline function and variational principle, generalized B spline smoothing filter is constructed, which realizes the direct spline transform in the sense of smoothing filtering, and improves the anti-noise ability of edge detection in conjunction with edge detection template operator. Experiments indicate this algorithm can extract target edge reliably, whether its extraction effect or anti-noise capacity are superior to conventional differential operator.