![]() |
(7) |
![]() |
(8) |
Eq. 9 is the entire filtering process. Described in words:
Fast algorithms exist to compute the DFT for multiples of small prime numbers. 6Even if the original image is not of a convenient size, it can be padded with zeros to make it of such a size. These algorithms typically take of the order of NlogN operations to compute the DFT of a sequence of length N.
Since the images are of size
, the computational overhead of step 2 in our technique is
. In step 3, we need to do
multiplications and take an inverse DFT, making the overhead
. Since step 3 has to be done
times, the total computational overhead of the modified technique is only
. As in Section 2.3, we don't count the maximum operation in our computational overhead calculation. Note that our computational overhead does not depend on
, the size of the filter. This is because we pad our filters to match the size of the images.
Again using a
image and a
elliptical filter in 10-degree increments, we have
,
and
. The computational overhead of the modified technique is of the order of 132 million operations. Recall that the original technique took on the order of 19 billion operations. We get an improvement of more than two orders of magnitude. In practice, we won't achieve such a high improvement because the original technique can be implemented with integer arithmetic but the DFT technique requires floating point operations, which are slower on most computers.
Comparing the orders of magnitude calculations, we expect an improvement of
. 7 For a
image with a filter size of
, the improvement should, in theory, be about 150 times. In practice (as can be seen from Table 1), we can do the filtering about 50 times faster by using the technique described in this paper. It is also worth noting that for small filter sizes (
less than 5), the technique actually degrades performance.
The idea behind the speedup in this paper, that convolution can be performed faster on computers using Fourier Transforms, is more than 30 years old; Cooley and Tukey (1965) introduced the fast algorithm that forms the basis for most FFT algorithms today (including the one we used, by Frigo and Johnson (1998)). By 1967, there was a special issue of the IEEE Transactions on Audio and Electroacoustics devoted to Fast Fourier Transform methods.