Title: ASAM Image Processing 20082009
1ASAM - Image Processing2008/2009
- Lecture 6
- The frequency domain
Ioannis Ivrissimtzis 13-Nov-2008
2Overview
- Basis change
- Walsh - Hadamard transform
- Tensor product transforms
3Spatial/Frequency domain
- The analysis and processing of an image can be
done in different - domains
- The spatial domain where values correspond to
pixel intensities. - The frequency domain.
- Until now we have always worked in the spatial
domain.
4Basis change
- Example
- Consider two numbers a and b.
- We can represent a and b by themselves, but we
can also represent - them by two different numbers, for example,
(ab)/2 and (a-b)/2. - Indeed, if we know a and b then we can find
(ab)/2, (a-b)/2. - If we know (ab)/2 and (a-b)/2 then we can find
a and b.
5Basis change
- In matrix language we have
for the first representation and
for the second.
6Basis change
7Basis change
- Why use a more complicated basis?
- In some applications we may have to work with an
incomplete set of - coefficients.
- In the previous example, in the first base, the
first coefficient is a. In - the second base, the first coefficient is (ab)/2
which is more - representative.
- In image transmission we prefer the first 10 of
the data to give an - approximation of the whole image, rather than an
exact description of - a small part of it.
8Example
- The four matrices below form a basis for the 4x1
matrices. - We can write any other 4x1 matrix as a linear
combination of them, in a - unique way.
9Example
- Writing a 4x1 matrix in this basis is trivial. We
have
giving,
10Example
- For example
- We call this base, the natural base.
11Example
- A different basis for the 4x1 matrices
- We can write any other 4x1 matrix as a linear
combination of the four - matrices above, in a unique way.
12Basis change
- How do we write a 4x1 matrix in the new basis?
13Basis change
- Let the coefficients be the unknowns
.
14Example
- We can rewrite the equation as a linear system in
matrix form.
15Example
- To solve the system we invert the transformation
matrix.
16Example
- The inverse of this matrix is
17Example
We get,
- This is called the transform of this.
18Example
19Example
20Overview
- Basis change
- Walsh - Hadamard transform
- Tensor product transforms
21The general W-H transform
- The Hadamard matrix Hn of order 2n is defined
recursively by
and
A sequency ordering of its rows will give the
corresponding Walsh- Hadamard transform.
22Walsh-Hadamard transform
- The Walsh-Hadamard transform of order 8 is given
by the matrix
23Walsh-Hadamard transform
- The number of sign changes in a row of the matrix
is called sequency.
0 1 2 3 4 5 6 7
The rows of the Walsh-Hadamard matrix have been
reordered by sequency.
24Walsh-Hadamard transform
- The natural basis for 8x1 matrices
25Walsh-Hadamard transform
The Walsh-Hadamard basis for 8x1 matrices
26Two dimensional W-H transform
- The 2D Walsh-Hadamard transform is the tensor of
the 1D transform. - Example Every 4x4 greyscale image can be
uniquely written in the - Walsh-Hadamard basis as linear combination of
these 16 images.
The white squares denote 1s and the black
squares denote -1s.
27Two dimensional W-H transform
How do we compute these sixteen images? Take
the corresponding elements of the 1D basis and
find their tensor product.
(1,-1,1,-1)
(1,-1,-1,1)
(1,-1,-1,1)
(1,-1,1,-1)
28Two dimensional W-H transform
29Overview
- Basis change
- Walsh - Hadamard transform
- Tensor product transforms
30Tensor product transforms
- How can we compute T(F), the W-H transform of a
2D image F ? - It may seem that we have to solve a large and
complicated linear - system.
- In fact, the 2D W-H transform is computed
directly by - where H is the W-H matrix of the 1D transform and
H' is the transpose - of H.
31Tensor product transforms
- That is, to find the W-H transform of an image,
we multiply it with the - Hadamard matrix from the left and its transpose
from the right.
The original Image A
The transform of A
The Hadamard matrix H
The transpose of H
32Tensor product transforms
- To see why this happens we first need to
introduce the notion of - orthogonality.
- We say that a matrix is orthogonal if its inverse
is equal to its transpose.
The Hadamard matrices are orthogonal.
33Tensor product transforms
- Consider an image with all its pixels equal to 0,
except one which has - value 1. Notice that this is an element of the
natural basis. We have
34Tensor product transforms
- This is equivalent to the tensor product of the
two corresponding 1D basis - images
35Tensor product transforms
- To put it all together, let B be an orthogonal
matrix corresponding to an - 1D basis. Then, TB-1 is the transform matrix.
- Let A be a 2D image. We have to show that
ZTAT' is the transform of - A corresponding to the tensor product of the 1D
basis B. - To see this, let be the (u, v)
elements of the 2D natural and - transform basis, respectively.
36Tensor product transforms
- The latter means that the matrix Z gives indeed
the coefficients for - writing A in the tensor product basis of B.