  It is well-known that spatial averaging can be realized (in space or
frequency domain) using algorithms whose complexity does not depend on the size
or shape of the filter. These fast algorithms are generally referred to as
constant-time or O(1) algorithms in the image processing literature. Along with
the spatial filter, the edge-preserving bilateral filter [Tomasi1998] involves
an additional range kernel. This is used to restrict the averaging to those
neighborhood pixels whose intensity are similar or close to that of the pixel
of interest. The range kernel operates by acting on the pixel intensities. This
makes the averaging process non-linear and computationally intensive,
especially when the spatial filter is large. In this paper, we show how the
O(1) averaging algorithms can be leveraged for realizing the bilateral filter
in constant-time, by using trigonometric range kernels. This is done by
generalizing the idea in [Porikli2008] of using polynomial range kernels. The
class of trigonometric kernels turns out to be sufficiently rich, allowing for
the approximation of the standard Gaussian bilateral filter. The attractive
feature of our approach is that, for a fixed number of terms, the quality of
approximation achieved using trigonometric kernels is much superior to that
obtained in [Porikli2008] using polynomials.
