Title: Discrete Cosine Transform DCT
1Discrete Cosine Transform (DCT)
Many people would sooner die than think. In fact
they do. - Bertrand Russell
2Review
- Convert from RGB to YCbCr
- Pixels are grouped into 8x8 pixels called data
units - Discrete Cosine Transform(DCT) applied to each
data unit to create an 8x8 map of frequency
components that represent the average pixel value
and successive higher frequency changes within a
group
3Overview
- What are image transforms?
- What are they used for?
- Wave transforms (cos, sin)
- DCT
4What is an image transform?
- Computers store images as an NxN matrix of values
that represent pixels - For example
- 256 gray-scale image each pixel is stored as a
value between 0 255 - 0 black pixel
- 255 white pixel
- Value between are shades of gray
5What are they used for?
- We can apply mathematical functions to the
matrices to rotate, skew, compressin other words
TRANSFORM an image - Remember quad trees?
- Lets look at an example
6Image Transform Example
M This is obviously not the real matrix for
this image, just pretend for the sake of the
example
7Image Transform Example
Suppose (x) transform function
In this case its an invert function
(M)
8More practical example
M
M
Apply some arbitrary transform on M
9More practical example
M
M
Notice how the higher values (low frequency) are
now positioned toward the top left and the lower
values (high frequency) are positioned toward the
bottom right
10Wave Transforms
- DCT and Fourier transforms convert images from
time-domain to frequency-domain to decorrelate
pixels - Time-domain
- x-axis time, y-axis amplitude
- Frequency-domain
- x-axis frequency, y-axis amplitude
11Wave Transforms
Amplitude
Frequency
12DCT One Dimensional
where
n size p pixel G coefficients
13DCT 2D
14DCT
- Remember that JPEG breaks an image into 8x8 units
- So for DCT n 8
- Each pixel is scanned and the transform is
applied - Just like our example in the beginning We get a
matrix with new values
15DCT Frequency Distro
16DCT Frequency Distro
17DCT Why does it do this?
- DCT takes advantage of redundancies in the data
by grouping pixels with similar frequencies
together - Higher frequencies lower number
- Lower frequencies higher number
- If lossy compression is acceptable, then each
data unit can then be divided by quantization
coefficient (QC)
18DCT (cont)
19Summary
- What are image transforms?
- What are they used for?
- Wave transforms (cos, sin)
- DCT
20Sources
- Salomon D. A Guide to Data Compression Methods,
2002 - Salomon D. Data Compression The Complete
Reference, 2000 - Lehar S. An Intuitive Explanation of Fourier
Theory. http//cns-alumni.bu.edu/slehar/fourier/
fourier.html February 2005 - Marshall D. Discrete Cosine Transform,
http//www.cs.cf.ac.uk/Dave/Multimedia/node231.htm
lDCTbasis February 2005 - Cabeen K Gent P. Image Compression and the
Discrete Cosine Transform. http//online.redwoods
.cc.ca.us/instruct/darnold/laproj/Fall98/PKen/dct.
pdf February 2005
21Questions?