Title: Image Based Information Processing
1Image Based Information Processing
- Lecturer Steve Maybank
- School of Computer Science and Information
Systems - sjmaybank_at_dcs.bbk.ac.uk
- Spring 2009
- Week 4The Fourier Transform and the Discrete
Cosine Transform
2History
- Jean Baptiste Joseph Fourier, born 1768 in
Auxerre, France. - Discovers that any continuous function can be
written as a sum of sines and cosines. - Publishes memoir (1807) and book La Théorie
Analytique de la Chaleur (1822). - First applications to find solutions to the heat
equation which describes heat flow in a solid. - Mathematicians take 100 years to adjust to this
discovery.
3Sines and Cosines
4Decomposition of a Function
5Discrete Cosine Transform
- Any discrete 1-dimensional image with n pixels
can be written exactly as the sum of n cosines.
Eg for x0, x1, x 2, there exist numbers a0, a1
, a2 such that
6Matrix for the Discrete Cosine Transform
- The DCT coefficients a of a 1-dimensional image x
with n pixels are defined by aMx where M is an
nxn matrix. - The entries of M and M-1 are cosines.
- The inverse transform is xM-1a, thus x is a
linear combination of cosines.
7Properties of the DCT
- Does not require complex numbers, because M
contains real numbers only. - Linear if aMx and bMy then
- r as bM(r xs y)
- Preserves the length of vectors,
- aMxx
- Easily invertible, because M-1 MT.
8DCT for 2-Dimensional Images
- If I is a 2-dimensional nxn image then the DCT of
I is the nxn matrix A defined by - AMIMT
- Note that IMTAM
9Why Use the DCT?
- If an image contains uniform regions then only a
few DCT coefficients are large. - Most of the image information is recorded by a
small number of coefficients
10Extreme Example
(and similarly for any nxn matrix with all
entries equal to 1)
11Example 1 Horizontal Edge
Absolute values of DCT coefficients
8x8 image
12Example 2 Diagonal Edge
Absolute values of DCT coefficients
8x8 image
13Example 3 Random Image
Absolute values of DCT coefficients
8x8 image
There is no advantage in finding the DCT
14First Few Components of a DCT Basis
15JPEG Compression
- The image is divided into 8x8 blocks and the DCT
is applied to each block. - The smaller DCT coefficients are set to zero.
- The more coefficients that are set to zero, the
larger the compression.
16Fourier Transform
- The image is expressed as a sum of sines and
cosines. - The Fourier coefficients, F, of a 2-dimensional
image I are given by - FUIUT
- The matrix U contains complex values.
- The length is preserved, FI.
17FT and Filtering
- Low pass filtering reduce the high frequency
Fourier coefficients in F. - Effect smoothes sharp edges, reduces high
frequency noise. - High pass filtering reduce the low frequency
coefficients in F. - Effect emphases edges, increases contrast.
18Images
Magnitudes of the Fourier coefficients. High
frequencies at The centre.
Original image (Microsoft)
Grey level image
19Low Pass Filter Example
There are 240,000 Fourier coefficients of which
228,000 are set to zero. Note the blurring.
20High Pass Filter Example
Twenty Fourier coefficients out of 240,000 (!!)
are set to zero. Regions where the grey level
gradient is high are emphasised.
21The FT and Linear Filtering
- The FT can be used to implement linear filtering
efficiently (convolution theorem).
FT
Iimage Mmask
rij(I), rij(M)
FT-1
Products rij(I)rij(M)
Linearly filtered image