IMAGE COMPRESSION USING DISCRETE COSINE TRANSFORM A SEMINAR Submitted In partial fulfillment for the award of the Degree of Bachelor of Technology In Department of Electronics & Communication Engineering Supervisor Submitted by Mr. Rishabh Sharma Nancy Singal Department of Electronics & Communication Engineering
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
IMAGE COMPRESSION USING DISCRETE COSINE TRANSFORM
A
SEMINAR
Submitted
In partial fulfillment
for the award of the Degree of
Bachelor of Technology
In
Department of
Electronics & Communication Engineering
Supervisor Submitted by
Mr. Rishabh Sharma Nancy Singal Department of Electronics & Communication Engineering
Global Institute Of Technology,Jaipur
Rajasthan Technical University 2010- 2011
CANDIDATE’S DECLARATION
I hereby declare that the work,which,is being presented in the
SEMINAR,entitled
“IMAGE COMPRESSION USING DCT” in partial fulfillment for the award of
Degree
Of “Bachelor of Technology” in Deptt.of Electronics & Communication
Engineering,
Global Institute Of Technology,Jaipur,Rajasthan Technical University,Kota is
a record
Of my own interest,carried under the Guidance of J.P.Aggarwal.
Nancy Singal
B.Tech
Electronics & Communication
University Roll No.:EGJEC0777
Enrolment No.:
ACKNOWLEDGEMENT
The beatitude,bliss and euphoria that accompany the successful completion
of any task would not be completed without the expression of simple
virtues to the people who made it possible.
I feel immense pleasure in carrying my heartiest thanks and gratitude
to respected Faculty Member Mr. J.P.Aggarwal for their
guidance,suggestion and encouragement.
The Acknowledgement would not complete if I fail to expess my deep
sense of Obligation to almighty God and my family, without their help this
work would not have been completed.
Last but not least ,I thank all the concerned ones who directly or indirectly
helped me in this work.
Signature
Na
ncy Singal
Contents
Chapter Title Page No.
I Introduction i
1.1 Discrete cosine transform
1.1.1 Description
1.1.2 What is DCT
1.1.3 Mathematical Analysis
1.1.4 Classification
1.1.5 Advantages
1.1.6 Disadvantages
1.2 Image compression
1.2.1 Description
1.2.2 Types of image compression
1.2.1 Lossless compression
1.2.2 Lossy compression
1.2.3 Discrete cosine transform
1.2.3.1 Joint Photographic Expert
Group
1.2.3.2 Motion Picture Expert Group
II Literature Survey
2.1 Sub article X
2.1.1 Sub-Sub article
III Problem Identification
3.1 Sub article Y
3.1.1 Sub-Sub article
IV Methodology
ABSTRACT
Image Compression addresses the problem of reducing the amount of data required to represent
the digital image. Compression is achieved by the removal of one or more of
three basic data redundancies: (1) Coding redundancy, which is present when less than optimal
(i.e. the smallest length) code words are used; (2) Interpixel redundancy, which results from
correlations between the pixels of an image & (3) psycho visual redundancy which is due to
data that is ignored by the human visual system (i.e. visually
nonessential information). Huffman codes contain the smallest possible number of code
symbols (e.g., bits) per source symbol (e.g., grey level value) subject to the constraint that the
source symbols are coded one at a time. So, Huffman coding when combined with technique of
reducing the image redundancies using Discrete Cosine Transform (DCT)
helps in compressing the image data to a very good extent.
The Discrete Cosine Transform (DCT) is an example of transform coding. The current JPEG
standard uses the DCT as its basis. The DC relocates the highest energies to the upper left
corner of the image. The lesser energy or information is relocated into other areas. The DCT is
fast. It can be quickly calculated and is best for images with smooth edges like photos with
human subjects. The DCT coefficients are all real numbers unlike the Fourier
Transform. The Inverse Discrete Cosine Transform (IDCT) can be used to retrieve the image
from its transform representation. The Discrete wavelet transform (DWT) has gained
widespread acceptance in signal processing and image compression. Because of their inherent
multi-resolution nature, wavelet-coding schemes are especially suitable for applications where
scalability and tolerable degradation are important. Recently the JPEG committee has released
its new image coding standard, JPEG-2000, which has been based upon DWT
CHAPTER-I
INTRODUCTION
1.1Discrete Cosine Transform
1.1.1 DISCRIPTION
Compressing an image is significantly different than compressing raw binary data. Of course,
general purpose compression programs can be used to compress images, but the result is less
than optimal. DCT has been widely used in signal processing of image. The one-dimensional
DCT is useful in processing one-dimensional signals such as speech waveforms. For analysis of
two dimensional (2D) signals such as images, we need a 2D version of the DCT data,
especially in coding for compression, for its near-optimal performance. JPEG is a commonly
used standard method of compression for photographic images. The name JPEG stands for
Joint Photographic Experts Group, the name of the committee who created the standard. JPEG
provides for lossy compression of images. Image compression is the application of data
compression on digital images. In effect, the objective is to reduce redundancy of the image
data in order to be able to store or transmit data in an efficient form. The best image quality at a
given bit-rate (or compression rate) is the main goal of image compression. The main
objectives of this paper are reducing the image storage space, Easy maintenance and providing
security, Data loss cannot effect the image clarity, Lower bandwidth\requirements for
transmission, Reducing cost.
1.1.2 WHAT IS DCT
A discrete cosine transform (DCT) expresses a sequence of finitely many data points in terms
of a sum of cosine functions oscillating at different frequencies. DCTs are important to
numerous applications in science and engineering, from lossy compression of audio and images
(where small high-frequency components can be discarded), to spectral methods for the
numerical solution of partial differential equations on, it turns out that cosine functions are
much more efficient (as explained below, fewer are needed to approximate a typical signal,
whereas for differential equations the cosines express a particular choice of boundary
conditions. In particular, a DCT is a Fourier-related transform similar to the discrete Fourier
transform (DFT), but using only real numbers. DCTs are equivalent to DFTs of roughly twice
the length, operating on real data with even symmetry (since the Fourier transform of a real and
even function is real and even), where in some variants the input and/or output data are shifted
by half a sample. There are eight standard DCT variants, of which four are common.
The most common variant of discrete cosine transform is the type-II DCT, which is often called
simply "the DCT"; its inverse, the type-III DCT, is correspondingly often called simply "the
inverse DCT" or "the IDCT". Two related transforms are the discrete sine transform (DST),
which is equivalent to a DFT of real and odd functions, and the modified discrete cosine
transform (MDCT), which is based on a DCT of overlapping data.
1.1.3 MATHMATICAL ANALYSIS
DCT Equation
The DCT equation (Eq.1) computes the i, jth entry of the DCT of an image.
p (x, y) is the x,yth element of the image represented by the matrix p. N is the size of the block
that the DCT is done on. The equation calculates one entry (i, j th) of the transformed image
from the pixel values of the original image matrix. For the standard 8x8 block that JPEG
compression uses,N equals 8 and x and y range from 0 to 7. Therefore D (i, j ) would be as in
Equation (3).
Because the DCT uses cosine functions, the resulting matrix depends on the horizontal and
vertica frequencies. Therefore an image black with a lot of change in frequency has a very
random looking resulting matrix, while an image matrix of just one color, has a resulting matrix
of a large value for the first element and zeroes for the other.
THE DCT MATRIX:
To get the matrix form of Equation (1), we will use the following equation,
For an 8x8 block it results in this matrix:
The first row (i : 1) of the matrix has all the entries equal to 1/ 8 as expected from Equation
(4).The columns of T form an orthonormal set, so T is an orthogonal matrix. When doing the
inverse DCT the orthogonality of T is important, as the inverse of T is T’ which is easy to
calculate.
1.1.4 CLASSIFICATION
DCT-I
The DCT-I is exactly equivalent (up to an overall scale factor of 2), to a DFT of 2N − 2 real
numbers with even symmetry. For example, a DCT-I of N=5 real numbers abcde is exactly
equivalent to a DFT of eight real numbers abcdedcb (even symmetry), divided by two.
(In contrast, DCT types II-IV involve a half-sample shift in the equivalent DFT.)
Note, however, that the DCT-I is not defined for N less than 2. (All other DCT types are
defined for any positive N.)
Thus, the DCT-I corresponds to the boundary conditions: xn is even around n=0 and even
around n=N-1; similarly for Xk
Some authors further multiply the x0 and xN-1 terms by √2, and correspondingly multiply the X0
and XN-1 terms by 1/√2. This makes the DCT-I matrix orthogonal, if one further multiplies by an
overall scale factor of , but breaks the direct correspondence with a real-even DFT.
The DCT-I is exactly equivalent (up to an overall scale factor of 2), to a DFT of 2N − 2 real
numbers with even symmetry. For example, a DCT-I of N=5 real numbers abcde is exactly
equivalent to a DFT of eight real numbers abcdedcb (even symmetry), divided by two. (In
contrast, DCT types II-IV involve a half-sample shift in the equivalent DFT.)
Note, however, that the DCT-I is not defined for N less than 2. (All other DCT types are
defined for any positive N.)
Thus, the DCT-I corresponds to the boundary conditions: xn is even around n=0 and even
around n=N-1; similarly for Xk.
DCT-II
The DCT-II is probably the most commonly used form, and is often simply referred to as "the
DCT".This transform is exactly equivalent (up to an overall scale factor of 2) to a DFT of 4N
real inputs of even symmetry where the even-indexed elements are zero. That is, it is half of the
DFT of the 4N inputs yn, where y2n = 0, y2n + 1 = xn for , and y4N − n = yn for 0 < n < 2N.
Some authors further multiply the X0 term by 1/√2 and multiply the resulting matrix by an
overall scale factor of (see below for the corresponding change in DCT-III). This makes the
DCTII matrix orthogonal, but breaks the direct correspondence with a real-even DFT of half-
shifted input.
The DCT-II implies the boundary conditions: xn is even around n=-1/2 and even around n=N-
1/2; Xk is even around k=0 and odd around k=N.
DCT-III
Because it is the inverse of DCT-II (up to a scale factor, see below), this form is sometimes
simply referred to as "the inverse DCT" ("IDCT").
Some authors further multiply the x0 term by √2 and multiply the resulting matrix by an overall
scale factor of (see above for the corresponding change in DCT-II), so that the DCT-II and
DCT-III are transposes of one another. This makes the DCT-III matrix orthogonal, but breaks
the direct correspondence with a real-even DFT of half-shifted output.
The DCT-III implies the boundary conditions: xn is even around n=0 and odd around n=N; Xk is
even around k=-1/2 and even around k=N-1/2.
DCT-IV
The DCT-IV matrix becomes orthogonal (and thus, being clearly symmetric, its own inverse) if
one further multiplies by an overall scale factor of .
A variant of the DCT-IV, where data from different transforms are overlapped, is called the