0% found this document useful (0 votes)
51 views44 pages

Discrete Cosine Transform: Theory and Applications in Image Compression

The document discusses the Discrete Cosine Transform (DCT), a technique used widely in lossy image compression. It explains that DCT decorrelates correlated pixel data, concentrating image information into fewer coefficients. The DCT approximates the optimal Karhunen-Loeve Transform for image compression. It is more energy compacting than the Discrete Fourier Transform. The document outlines how DCT is used in the JPEG image compression standard, through steps of transformation, quantization, encoding, and entropy coding.

Uploaded by

MOVIETADKA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views44 pages

Discrete Cosine Transform: Theory and Applications in Image Compression

The document discusses the Discrete Cosine Transform (DCT), a technique used widely in lossy image compression. It explains that DCT decorrelates correlated pixel data, concentrating image information into fewer coefficients. The DCT approximates the optimal Karhunen-Loeve Transform for image compression. It is more energy compacting than the Discrete Fourier Transform. The document outlines how DCT is used in the JPEG image compression standard, through steps of transformation, quantization, encoding, and entropy coding.

Uploaded by

MOVIETADKA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Discrete Cosine Transform

Theory and applications in image


compression

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
Introduction
 Pixels in images show lot of correlation
with neighboring pixels.
 In video consecutive frames show
correlation.
 Transformation is mapping from
correlated to uncorrelated data.
 DCT is the key transform used in most
visual systems.
DCE//SEMVI// Extc//Dr. Vishakha
Kelkar
• Karhunen Loeve Transform (KLT) is the Optimal

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Comparision of DFT-DCT
 DFT has real or complex coeff.s
 DCT is a real transform
 Energy compaction in DCT is much
higher compared to DFT
 For compression applications DCT is
preferred over DFT.

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Compare DCT and DFT
8 16 24 32 40 48 56 64
DFT
DCT
36 10 10 6 6 4 4 4 100 -52 0 -5 0 -2 0 0.4

Four least coeff.made zero

36 10 10 6 0 0 0 0 100 -52 0 -5 0 -2 0 0

Take inverse find o/p stream

24 12 20 32 40 51 59 48 8 15 24 32 40 48 57 63

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
Discrete Cosine transform
 The most common DCT definition of a
1-D sequence of length N is
 D(u)=c(u)∑f(x)cos{pi*(2x+1)*u/2N}
For u,x=0,1,2,…N-1
c(u)=(1/N)1/2 for u=0
=(2/N)1/2 for u=1,2,….N-1

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Discrete Cosine transform
Similarly inverse transform is defined as
 f(x)=c(u)∑D(u)cos{pi*(2x+1)*u/2N}

For u,x=0,1,2,…N-1
c(u)=(1/N)1/2 for u=0
=(2/N)1/2 for u=1,2,….N-1

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Discrete Cosine transform
 The DCT of a one dimensional signal of
length n can be calculated by:
Dct-of-signal(n)=
DCT-matrix(nxn)*signal(n)

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Discrete Cosine transform
 In the defn of DCT ignoring C(u) and f(x)
they are all cosine functions called basis
functions.
 One dimensional DCT basis fctn are shown
 For images 2-D DCT is required.
 Two dimensional DCT functns can be formed
by multiplying horizontally oriented Id basis
functns by vertically oriented same functns

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Discrete Cosine transform

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Discrete Cosine transform

Of order 8

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Discrete Cosine transform
 It can be observed that D(0)= ∑f(x)
is average of the samples.this is called
DC coeff.remaining are called AC coeff.
 D(4)= .5 .5 .5 .5
.65 .27 -.27 -.65
.5 -.5 -.5 .5
.27 -.65 .65 -.27
DCE//SEMVI// Extc//Dr. Vishakha Kelkar
DCE//SEMVI// Extc//Dr. Vishakha
Kelkar
DCE//SEMVI// Extc//Dr. Vishakha
Kelkar
DCT matrix of order 8

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


2-dimensional DCT (2D-DCT)

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


DCT for images
 DCT for image of size nxn can be
calculated by:
D=d*A*d’ where D=DCT of image
d=1-D DCT matrix of order nxn
A=image matrix of order nxn
 Inverse DCT can be calculated as

A=d’*D*d
DCE//SEMVI// Extc//Dr. Vishakha
Kelkar
Discrete Cosine transform
 Properties of DCT
 Decorrelation:
It take correlated data and decorrelates it. If
the data is correlated then most of the DCT
coeff.s are zero.
 Energy compaction:
It concentrates energy in just first few coeffs.
 Because of these its most commonly used
transform in image compression.

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Correlated image with its DCT

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
Correlated image with its DCT

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
Uncorrelated Image with its
DCT

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
Uncorrelated Image with its
DCT

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


What is image compression?

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Lossy compression
If we accept some distortion, we can achieve much
higher compression ratio.

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Perception in Image
coding

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
JPEG
 Joint Photographic Experts Group (JPEG) is an
ISO standard committee with a mission on
“Coding and compression of still images”.
 JPEG coding standard (1988): DCT (discrete
cosine transform) based transform coding to
compress bit-map images.
 JPEG2000 efforts started in 1996 to use new
methods such as fractals or wavelets. The
target deliver date is year 2000 and hence the
name.

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Discrete Cosine transform

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Transformer

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Quantizer

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Coder

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


DCT- Based Image Compression

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
Quantization of DCT Coefficients

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
An example of quantization
table

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Zigzag Scan Order for 8 x 8
DCT coefficients

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Original & leveled off matrices

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


DCT Matrix

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Quantized matrix &
Decompression

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
Comparison of original
&reconstructed matrices

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Entropy Coding

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Coding of Quantized DCT Coefficients

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


JPEG blockdiagram

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
Compresssion results using
DCT
original 75%

50% 25%

DCE//SEMVI// Extc//Dr. Vishakha Kelkar


Compresssion results using
DCT

DCE//SEMVI// Extc//Dr. Vishakha


Kelkar
Compresssion results using
DCT

DCE//SEMVII// Extc//Vishakha Kelkar

You might also like