Discrete Cosine Transform
Discrete
Cosine
Transform
Nuno Vasconcelos
UCSD
Discrete Fourier Transform
• last classes, we have studied the DFT
• due to its computational efficiency the DFT is very
popula
r
• however, it has strong disadvantages for some
applications
applications
–it is complex
–it has poor energy compaction
• energy compaction
– is the ability to pack the energy of the spatial sequence into as
few fre
q
uenc
y
coefficients as
p
ossible
qy p
–this is very important for image compression
– we represent the signal in the frequency domain
if compaction is high we only have to transmit a few coefficients
2
–
if
compaction
is
high
,
we
only
have
to
transmit
a
few
coefficients
– instead of the whole set of pixels
Discrete Cosine Transform
•a much better transform,
from this point of view, is the DCT
–
in this example we see the
amplitude spectra of the image above
– under the DFT and DCT
– note the much more
concentrated histogram
obtained with the DCT
• why is energy compaction
important?
–
the main reason is
–
the
main
reason
is
image compression
– turns out to be beneficial
in other applications
3
in
other
applications
Image compression
• an image compression system has three main blocks
–a transform (usually DCT on 8x8 blocks)
–a quantizer
()
–
a lossless
(
entropy
)
code
r
• each tries to throw away information which is not
essential to understand the ima
g
e
,
but costs bits
4
g,
Image compression
• the transform throws away correlations
– if you make a plot of the value of a pixel as a function of one of
its neighbors
its
neighbors
– you will see that the pixels are highly correlated (i.e. most of the
time they are very similar)
–
this is
j
ust a conse
q
uence of the fact that surfaces are smooth
5
j
q