Some basic knowledge about the filtering in frequency domain, all concluded from the book “Digital Image Processing”
1. The 1-D discrete Fourier transform (DFT) is,
and the inverse discrete Fourier transform (IDFT) is,
It indicates that, for each frequency u , all discrete variable
2. Both the DFT and IDFT are infinitely periodic, with period
M
. That is,
where k is an integer.
3. The 2-D discrete Fourier transform is,
where, u=0,1,2,...,M−1;v=0,1,2,...,N−1
and the inverse discrete Fourier transform is,
for x=0,1,2,...,M−1;y=0,1,2,...,N−1
4. As in 1-D case, the 2-D Fourier transform and its inverse are infinitely periodic in the
u
and
where k1 and k2 are integers.
5. Fourier transform pair satisfies the following translation and rotation properties,
the first equation means, multiplying f(x,y) by the exponential shown shifts the origin of the DFT to (u0,v0) and, conversely, multiplying F(u,v) by the negative of that exponential shifts the origin of f(x,y) to (x0,y0) .
Besides the translation cases, the Fourier transform pairs also has the following property,
here using the polar coordinates,
that indicates that rotating f(x,y) by an angle θ0 rotates F(u,v) by the same angle.Conversely, rotating F(u,v) rotates f(x,y) by the same angle.
The translation property is very useful,
Consider the 1-D spectrum in the below Figure, the transform data in the interval from 0 to
M−1
consists of two back-to-back half periods meeting at the point
M/2
. For display and filtering purposes, it is more convenient to have in this interval a complete period of the transform in which the data are contiguous with the aid of below equation,
if we set u0=M/2 , the exponential term will be (−1)x , and the Fourier form will shift M/2 , that is,
so, the F(0) is at the center of the interval [0,M−1]
Consider the same way in 2-D case, multiply the exponential term with the original digital image data
f(x,y)
will shift the Fourier Form
F(0,0)
at
(M/2,N/2)
, the center of the intervals
[0,M−1]
and
[0,N−1]
, as shown below.
6. In fact, the DFT is a complex , which is consist of real part and imaginary part. the magnitude of the DFT is called the Fourier spectrum,
and
is called the phase angle.
where the R and
7. It’s clear from the Fourier equation that,
which indicates that the zero-frequency term is proportional to the average value of f(x,y) , that is,
where f¯(x,y) denotes the average value of f . Sometimes,
8. The 2-D DFT is separable into 1-D transforms,
where,
We can see, F(x,v) is simply the 1-D DFT of a row of f(x,y) . By varying x from 0 to M-1, we compute a set of 1-D DFTs for all rows of
9. Actually, the 2-D DFT is like a decomposition of an image into complex exponential (i.e. sines and cosines)
here is one Fourier transform illustration of random 1-D function f(x) , which can be regarded as a series of cosine and sine curves.
10. We refer to the domain of
t
as the spatial domain, and the domain of
For 1-D case, the discrete equivalent of the convolution is,
for x=0,1,2,...,M−1 , where the minus sign accounts for the flipping, and x is the displacement needed to slide one function past the other.
Here gives one 1-D discrete convolution example, the left column of the below figure implements convolution of two functions,
But, one point differs, instead of computing the convolution directly in the spatial domain, if we use the DFT and the convolution theorem to obtain the same result as the left column of the above figure, we must take into account the periodicity inherent in the expression for the DFT. This is equivalent to convolving the two periodic functions in the first two ones on the right column part of the above figure. Proceeding with these two functions will yield the incorrect result, as the last one on the right column part of the figure. The problem stays the two functions interfere with each other to cause what is commonly referred to as wraparound error.
Fortunately, the solution to the wraparound error problem is simple. Consider the two functions
f(x)
and
h(x)
composed of A and B samples, respectively. It can be shown that if we append zeros to both functions so that they have the same length, denoted by P, then wraparound is avoided by choosing,
This process is called zero padding. In a nut shell, to obtain the same convolution result between the “straight” representation of the convolution equation approach, and the DFT approach, functions must be padded prior to computing their transforms. It is the same in 2-D case, let f(x,y) and h(x,y) be two images arrays of sizes A∗B and C∗D pixels, respectively, wraparound error in their circular convolution can be avoided by padding these functions with zeros, as follows:
with