You are on page 1of 56

Jpeg Image compression and decompression

CHAPTER 1 PREAMBLE
1.1 GENERAL INTRODUCTION
In todays digital world, when we see digital movie, listen digital music, read digital mail, store documents digitally, making conversation digitally, we have to deal with huge amount of digital data. So, data compression plays a very significant role to keep the digital world realistic. If there were no data compression techniques, we would have not been able to listen to songs over the Internet, see digital pictures or movies, or we would have not heard about video conferencing or telemedicine. How data compression made it possible? What are the main advantages of data compression in digital world? There may be many answers but the three obvious reasons are the saving of memory space for storage, channel bandwidth and the processing time for transmission. Every one of us might have experienced that before the advent MP3, hardly 4 or 5 songs of wav file could be accommodated. And it was not possible to send a wav file through mail because of its tremendous file size. Also, it took 5 to 10 minutes or even more to download a song from the Internet. Now, we can easily accommodate 50 to 60 songs of MP3 in a music CD of same capacity. Because, the uncompressed audio files can be compressed 10 to 15 times using MP3 format and we have no problem in sending any of our favorite music to our distant friends in any corner of the world. Also, we can download a song in MP3 in a matter of seconds. This is a simple example of significance of data compression. Similar compression schemes were developed for other digital data like images and videos. Videos are nothings but the animations of frames of images in a proper sequence at a rate of 30 frames per second or higher. A huge amount of memory is required for storing video files. The possibility of storing 4/5 movies in DVD CD now rather than we used 2/3 CDs for a movie file is because compression. We will consider here mainly the image compression techniques.

1.2 JPEG IMAGE


Dept of IT, Dr AIT Page 1

Jpeg Image compression and decompression

JPEG is the most common image format used by digital cameras and other photographic image capture devices for storing and transmitting photographic images on the World Wide Web. JPEG compression is used in a number of image file formats these format variations are often not distinguished and are simply called JPEG. The term "JPEG" is an acronym for the Joint Photographic Experts Group which created the standard Image data compression is concerned with minimizing the number of bits required to represent an image with no significant loss of information. Image compression algorithms aim to remove redundancy present in the data (correlation of data) in a way which makes image reconstruction possible; this is called information preserving compression Perhaps the simplest and most dramatic form of data compression is the sampling of band limited images, where an infinite number of pixels per unit area are reduced to one sample without any loss of information. Consequently, the number of samples per unit area is infinitely reduced. Transform based methods better preserve subjective image quality, and are less sensitive to statistical image property changes both inside a single images and between images. Prediction methods provide higher compression ratios in a much less expensive way. If compressed images are transmitted an important property is insensitivity to transmission channel noise. Transform based techniques are significantly less sensitivity to channel noise. If transform coefficients are corrupted during transmission, the resulting image is spread homogeneously through the image or image part and is not too disturbing. Applications of data compression are primarily in transmission and storage of information. Image transmission applications are in broadcast television, remote sensing via satellite, military communication via aircraft, radar and sonar, teleconferencing, and computer communications.

CHAPTER 2 LITERATURE SURVEY


Gregory K. Wallace Dept of IT, Dr AIT Page 2

Jpeg Image compression and decompression

Multimedia Engineering Digital Equipment Corporation Maynard, Massachusetts Submitted in December 1991 for publication in IEEE Transactions on Consumer Electronics The JPEG Still Picture Compression Standard 2.1 ABSTRACT For the past few years, a joint ISO/CCITT committee known as JPEG (Joint Photographic Experts Group) has been working to establish the first international compression standard for continuous-tone still images, both grayscale and color. JPEGs proposed standard aims to be generic support a wide variety of applications for continuous-tone images. To meet the differing needs of many applications, the JPEG standard includes two basic compression methods, each with various modes of operation. A DCT-based method is specified for lossy compression, and a predictive method for lossless compression. JPEG features a simple lossy technique known as the Baseline method, a subset of the other DCT-based modes of operation. The Baseline method has been by far the most widely implemented JPEG method to date, and is sufficient in its own right for a large number of applications. This article provides an overview of the JPEG standard, and focuses in detail on the Baseline method. Advances over the past decade in many aspects of digital technology especially devices for image acquisition, data storage, and bitmapped printing and display - have brought about many applications of digital imaging. However, these applications tend to be specialized due to their relatively high cost. With the possible exception of facsimile, digital images are not commonplace in general-purpose computing systems the way text and geometric graphics are. The majority of modern business and consumer usage of photographs and other types of images take place through more traditional analog means. U. S. Mohammed1 and W. M. Abd-Elhafiez Department of Electrical Engineering, Assiut University, Assiut 71516, Egypt Received Jan 11, 2009; Revised Feb. 15, 2009; Accepted June 25, 2009 New Approaches for DCT-Based Image Compression Using Region of Interest Scheme Dept of IT, Dr AIT Page 3

Jpeg Image compression and decompression

2.2 ABSTRACT In this paper, new techniques for the DCT image coding based in pixels classifications are proposed. Two image coding approaches based on the object extraction are presented to study the effect of the object based image coding on the compression quality. Moreover, modification of the traditional JPEG method based on Region-of-interest coding is achieved. In the beginning, the image is subdivided into a block of pixels with block size of N x N. Firstly; the block must be classified as foreground block or background block based on a pre-processing step. The foreground blocks will be compressed via JPEG technique but with significant quantized coefficients and the DC coefficient only from one block in the background is used to code it. The simulation result shows that the proposed technique provides competitive compression performance relative to the most recent image compression techniques. Image compression maps an original image into a bit stream suitable for storage or transmission over suitable channel in a digital medium, such as multimedia communications, integrated services digital networks (ISDN), storage of medical images, archiving of finger prints and transmission of remote sensing images. The number of bits required to represent the coded image should be smaller than that required for the original image, so that one can use less communication time or storage space. A fundamental goal of data compression is to reduce the volume of data for transmission or storage while maintaining an acceptable fidelity or image quality. Consequently, pixels must not always be reproduced exactly as the originated also, the human visual system (HVS) should not detect the difference between original image and reproduced image.

Dept of IT, Dr AIT

Page 4

Jpeg Image compression and decompression

CHAPTER 3 IMAGE CLASSIFICATION AND DIGITIZATION


In general images can be defined as any two dimensional function f(x, y) where x, y are spatial coordinates, and amplitude of f at any pair of coordinates(x,y) is called intensity or gray level of the image at that point. 3.1 DIGITAL IMAGE When x, y and the amplitude values of f are all finite, discrete quantities, we call the image a digital image.

Fig 3.1 A Digital Image 3.1.1 Pixel: A pixel is a single point in a graphic image. Graphics monitors display pictures by dividing the display screen into thousands (or millions) of pixels, arranged in rows and columns. The pixels are so close together that they appear connected. The number of bits used to represent each pixel determines how many colors or shades of gray can be displayed. For example, in 8-bit color mode, the color monitor uses 8 bits for each pixel, making it possible to display 2 to the 8th power (256) different colors or shades of gray.

Dept of IT, Dr AIT

Page 5

Jpeg Image compression and decompression

3.2 IMAGE TYPES The different types of images are


1. Binary Images 2. Indexed Images 3. Intensity Images

4. Multi-frame Images
5. RGB Images.

3.2.1 Binary image: An image contains only black and white pixels. In MATLAB, a binary image is represented by a uint8 or double logical matrix containing 0's and 1's (which usually represent black and white, respectively). A matrix is logical when its "logical flag" is turned "on." We often use the variable name BW to represent a binary image in memory.
imb 2w r bga g 2r y r bin g2 d

(a)

(b)

(c)

Fig 3.2 (a) Binary Image (b) Intensity image (c) RGB image 3.2.2 Indexed image: An image pixel values are direct indices into an RGB color map. In MATLAB, an indexed image is represented by an array of class uint8, uint16, or double. The color map is always an mby-3 array of class double. We often use the variable name X to represent an indexed image in memory, and map to represent the color map. Dept of IT, Dr AIT Page 6

Jpeg Image compression and decompression

3.2.3 Intensity image: An image consists of intensity (grayscale) values. In MATLAB, intensity images are represented by an array of class uint8, uint16, or double. While intensity images are not stored with color maps, MATLAB uses a system color map to display them. We often use the variable name I to represent an intensity image in memory. This term is synonymous with the term "grayscale." 3.2.4 Multi-frame image: An image file contains more than one image, or frame. When in MATLAB memory, a multiframe image is a 4-Darray where the fourth dimension specifies the frame number. This term is synonymous with the term "multipage image." 3.2.5 RGB image: In an image each pixel is specified by three values -- one each for the red, blue, and green components of the pixel's color. In MATLAB, an RGB image is represented by an m-by-n-by-3 array of class uint8, uint16, or double. We often use the variable name RGB to represent an RGB image in memory. 3.3 IMAGE DIGITIZATION An image captured by a sensor is expressed as a continuous function f(x, y) of two coordinates in the plane. Image digitization means that the function f(x, y) is sampled into a matrix with m rows and n columns. The image quantization assigns to each continuous sample an integer value. The continuous range of image functions f(x, y) is split into k intervals. The finer the sampling (i.e. the larger m and n) and quantization (larger k) the better the approximation of the continuous image f(x, y). 3.4 SAMPLING AND QUANTIZATION To be suitable for computer processing an image function must be digitized both spatially and in amplitude. Digitization of spatial coordinates is called image sampling and amplitude digitization is called gray level quantization.

CHAPTER 4
Dept of IT, Dr AIT Page 7

Jpeg Image compression and decompression

IMAGE PROCESSING
The field of digital image processing refers to processing of digital image by means of a digital computer. A digital image is an image f(x, y) that has been discretized both in spatial coordinates and brightness. A digital image can be considered as a matrix whose row and column indices identifies a point in the image and corresponding matrix element value identifies the gray level at that point. The elements of such a digital array are called image elements, picture elements, pixels or pels. The last two being commonly used abbreviations of pictures elements. The term digital processing generally refers to a two dimensional picture by a digital computer. In a broader context it implies digital processing of any two dimensional data. In the form in which they usually occur, images are not directly amenable to computer analysis. Since computers work with numerical rather than pictorial data, an image must be converted to numerical form before processing. This conversion process is called digitization. The image is divided into small regions called picture elements or pixels . At each pixel location the image brightness is sample and quantized. This step generates an integer at each pixel representing the brightness or darkness of the image at that point. When this has been done for all pixels the image is represented by rectangular array of integers. Each location has allocation or address, and an integer value called gray level. This array digital data is now candidate for computer processing. 4.1 APPLICATIONS OF DIGITAL IMAGE PROCESSING
1. Office automation: optical character recognition; document processing cursive script

recognition; logo and icon recognition; etc.


2. Industrial automation: automation inspection system; non destructive testing; automatic

assembling; process related to VLSI manufacturing; PCB checking; etc.


3. Robotics: Oil and natural gas exploration; etc 4. Bio-medical: ECG, EEG, EMG analysis; cytological, histological and stereological

applications; automated radiology and pathology; x-ray image analysis; etc

Dept of IT, Dr AIT

Page 8

Jpeg Image compression and decompression

5. Remote sensing: natural resources survey and management; estimation related to

agriculture, hydrology forestry, mineralogy; urban planning; environment control and pollution control; etc
6. Criminology: finger print identification; human face registration and matching; forensic

investigation; etc.
7. Astronomy and space applications: restoration of images suffering from geometric and

photometric distortions; etc.


8. Information technology: facsimiles image transmission, video text; Video conferencing

and video phones; etc.


9. Entertainment and consumer electronics: HDVT; multimedia and video editing. 10.

Military applications: missile guidance and detection; target identification;

navigation of pilot less vehicle; reconnaissance; and range finding; etc.


11.

Printing and graphics art: color fidelity in desktop publishing; art conservation

and dissemination; etc.

CHAPTER 5 IMAGE COMPRESSION


Dept of IT, Dr AIT Page 9

Jpeg Image compression and decompression

Image Compression is a technology for reducing the quantity of data used to represent any content without excessively reducing the quality of the picture. It also reduces the number of bits required to store and/or transmit digital media. Compression is a technique that makes storing easier for large amount of data. 5.1 PRINCIPLES OF IMAGE COMPRESSION An ordinary characteristic of most images is that the neighboring pixels are correlated and therefore hold redundant information. The foremost task then is to find out less correlated representation of the image. Two elementary components of compression are redundancy and irrelevancy reduction. Redundancy reduction aims at removing duplication from the signal source image. Irrelevancy reduction omits parts of the signal that is not noticed by the signal receiver, namely the Human Visual System (HVS). In general, three types of redundancy can be identified:
1. Spatial Redundancy or correlation between neighboring pixel values, 2. Spectral Redundancy or correlation between different color planes or spectral bands and 3. Temporal Redundancy or correlation between adjacent frames in a sequence of images

especially in video applications. Image compression research aims at reducing the number of bits needed to represent an image by removing the spatial and spectral redundancies as much as possible.

Dept of IT, Dr AIT

Page 10

Jpeg Image compression and decompression

(a)

(b)

(c)

Fig 5.1 (a) Coding redundancy (b) Spatial redundancy (c) Irrelevant information 5.2 WHY DO WE NEED COMPRESSION? The figures in Table1 show the qualitative transition from simple text to full motion video data and the disk space needed to store such uncompressed data Multimedia Data A page of text Size/Duration 11'' x 8.5'' Bits/Pixel or Bits/Sample Varying resolution 8bps Uncompressed Size 16-32Kbits

Telephone quality speech Gray scale Image Color Image Medical Image SHD Image Full-motion Video

1 sec

64Kbits

512 x 512 512 x 512 2048 x 1680 2048 x 2048 640 x 480, 10sec

8bpp 24 bpp 12 bpp 24 bpp 24 bpp

2.1Mbits 6.29Mbits 41.3Mbits 100Mbits 2.21Gbits

Table 1: Multimedia data types and uncompressed storage space required The examples above clearly illustrate the need for large storage space for digital image, audio, and video data. So, at the present state of technology, the only solution is to compress these multimedia data before its storage and transmission, and decompress it at the receiver for play back. 5.3 FRAMEWORK OF GENERAL IMAGE COMPRESSION METHOD

Dept of IT, Dr AIT

Page 11

Jpeg Image compression and decompression

A typical lossy image compression system is shown in Fig. 3. It consists of three closely connected components namely (a) Source Encoder (b) Quantizer and (c) Entropy Encoder. Compression is achieved by applying a linear transform in order to decorrelate the image data, quantizing the resulting transform coefficients and entropy coding the quantized values.

Fig 5.4: A Image 5.3.1 Source

Typical Lossy Encoder Encoder (Linear

Transformer): A variety of linear transforms have been developed which include Discrete Fourier Transform (DFT), Discrete Cosine Transform (DCT), Discrete Wavelet Transform (DWT) and many more, each with its own advantages and disadvantages. 5.3.2 Quantizer: A quantizer is used to reduce the number of bits needed to store the transformed coefficients by reducing the precision of those values. As it is a many-to-one mapping, it is a lossy process and is the main source of compression in an encoder. Quantization can be performed on each individual coefficient, which is called Scalar Quantization (SQ). Quantization can also be applied on a group of coefficients together known as Vector Quantization (VQ). Both uniform and non-uniform quantizers can be used depending on the problems. 5.3.3 Entropy Encoder: Dept of IT, Dr AIT Page 12

Jpeg Image compression and decompression

An entropy encoder supplementary compresses the quantized values losslessly to provide a better overall compression. It uses a model to perfectly determine the probabilities for each quantized value and produces an appropriate code based on these probabilities so that the resultant output code stream is smaller than the input stream. The most commonly used entropy encoders are the Huffman encoder and the arithmetic encoder, although for applications requiring fast execution, simple Run Length Encoding (RLE) is very effective. It is important to note that a properly designed quantizer and entropy encoder are absolutely necessary along with optimum signal transformation to get the best possible compression. 5.4 TYPES OF COMPRESSION 1. Lossless vs. Lossy compression:

There are different ways of classifying compression techniques. Two of these would be mentioned here. The first categorization is based on the information content of the reconstructed image. They are 'lossless compression' and 'lossy compression schemes. In lossless compression, the reconstructed image after compression is numerically identical to the original image on a pixel bypixel basis. However, only a modest amount of compression is achievable in this technique. In lossy compression on the other hand, the reconstructed image contains degradation relative to the original, because redundant information is discarded during compression. As a result, much higher compression is achievable, and under normal viewing conditions, no visible loss is perceived (visually lossless).
2. Predictive vs. Transform coding:

The second categorization of various coding schemes is based on the 'space' where the compression method is applied. These are 'predictive coding' and 'transform coding'. In predictive coding, information already sent or available is used to predict future values, and the difference is coded. Since this is done in the image or spatial domain, it is relatively simple to implement and is readily adapted to local image characteristics. Differential Pulse Code Modulation (DPCM) is one particular example of predictive coding. Transform coding, also called block quantization, is an alternative to predictive coding. A block of data is unitarily transformed so that a large fraction of its total energy is packed in relatively few transform coefficients, which are quantized independently the optimum transform Dept of IT, Dr AIT Page 13

Jpeg Image compression and decompression

coder is defined as one that minimizes the mean square distortion of the reproduced data for a given number of total bits. Transform coding, on the other hand, first transforms the image from its spatial domain representation to a different type of representation using some well-known transforms mentioned later, and then codes the transformed values (coefficients). The primary advantage is that, it provides greater data compression compared to predictive methods, although at the expense of greater computations. 5.5 OBJECTIVE This process aims to study and understand the general operations used to compress a two dimensional gray scale images and to develop an application that allows the compression and reconstruction to be carried out on the images. The application developed aims to achieve: 1. Minimum distortion 2. High compression ratio 3. Fast compression time To compress an image the operations include linear transform, quantization and entropy encoding. The thesis will study the wavelet and cosine transformation and discuss the superior features that it has over Fourier transform. This helps to know how quantization reduces the volume of an image data before packing them efficiently in the entropy coding operation. To reconstruct the image, an inverse operation is performed at every stage of the system in the reverse order of the image decomposition. 5.6 DATA COMPRESSION VERSUS BANDWIDTH The mere processing of converting an analog signal into digital signal results in increased bandwidth requirements for transmission. For example a 5 MHz television signal sampled at nyquist rate with 8 bits per sample would require a bandwidth of 40 MHz when transmitted using a digital modulation scheme 5.7 DATA REDUNDANCY Data redundancy is the central issue in digital image compression. It is a mathematically quantifiable entity.

Dept of IT, Dr AIT

Page 14

Jpeg Image compression and decompression

If n1 and n2 represent the number of information carrying units in two data sets that represent the same information, the relative data redundancy Rd of the first data set can be defined as Rd=1-1/Cr Where Cr, commonly called the compression ratio, is Cr=n1/n2 For the case n2=n1, Cr=1 and Rd=0 indicating that the first representation contains no redundant data. When n2<<n1, Cr>infinite and Rd>1 implying significant compression and highly redundant data. In other case n2>>n1, Cr>0 and Rd>infinite, indicates that the second data set contains much more data than the original representation. 5.8 COMPRESSION RATIO The degree of data reduction as a result of the compression process is known as compression ratio. The ratio measures the quantity of compressed data. Compression ratio (C.R) = Length of original data string Length of compressed data string Increase of C>R causes more efficient the compression technique employed and vice versa.

CHAPTER 6 IMAGE COMPRESSION USING DCT


The compression will reduce the image fidelity, especially when the images are compressed at lower bit rates. The reconstructed images suffer from blocking artifacts and the image quality will be severely degraded under the circumstance of high compression ratios. In

Dept of IT, Dr AIT

Page 15

Jpeg Image compression and decompression

order to have a good compression ratio without losing too much of information when the image is decompressed we use 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. The JPEG process is a widely used form of lossy image compression that centers on the Discrete Cosine Transform. DCT and Fourier transforms convert images from time-domain to frequency-domain to decorrelate pixels. The DCT transformation is reversible. The DCT works by separating images into parts of differing frequencies. During a step called quantization, where part of compression actually occurs, the less important frequencies are discarded, hence the use of the term lossy. Then, only the most important frequencies that remain are used retrieve the image in the decompression process. As a result, reconstructed images contain some distortion; but as we shall soon see, these levels of distortion can be adjusted during the compression stage. The JPEG method is used for both color and black-and-white images. 6.1 THE JPEG PROCESS The following is a general overview of the JPEG process. JPEG stands for Joint Photographic Experts Group which is a commonly used method of compression for photographic images. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality. More comprehensive understanding of the process may be acquired as such given under:

1. The image is broken into 8x8 blocks of pixels. 2. Working from left to right, top to bottom, the DCT is applied to each block. 3. Each block is compressed through quantization. 4. The array of compressed blocks that constitute the image is stored in a drastically reduced amount of space.

Dept of IT, Dr AIT

Page 16

Jpeg Image compression and decompression

5. When desired, the image is reconstructed through decompression, a process that uses the Inverse Discrete Cosine Transform (IDCT). 6.2 THE DISCRETE COSINE TRANSFORM: Like other transforms, the Discrete Cosine Transform (DCT) attempts to decorrelate the image data. After decorrelation each transform coefficient can be encoded independently without losing compression efficiency. This section describes the DCT and some of its important properties. 6.2.1 The One-Dimensional DCT: The most common DCT definition of a 1-D sequence of length N is

. . . . . . . . . . 6.1 For u = 0, 1, 2 N1. Similarly, the inverse transformation is defined as

. . . . . . . . . . 6.2 For x = 0, 1, 2 N1 In and 6.2, (u) is defined as both equations 6.1

Dept of IT, Dr AIT

Page 17

Jpeg Image compression and decompression

. . . . . . . . . . 6.3

It is clear from first equation that for . . . . . . . . . . 6.4

Thus,

the

first

transform coefficient is the average value of the sample sequence. In literature, this value is referred to as the DC Coefficient. All other transform coefficients are called the AC Coefficients. The one-dimensional DCT is useful in processing one-dimensional signals such as speech waveforms. 6.2.2 The Two-Dimensional DCT: The Discrete Cosine Transform (DCT) is one of many transforms that takes its input and transforms it into a linear combination of weighted basis functions. These basis functions are commonly the frequency. The 2-D Discrete Cosine Transform is just a one dimensional DCT applied twice, once in the x direction, and again in the y direction. One can imagine the computational complexity of doing so for a large image. Thus, many algorithms, such as the Fast Fourier Transform (FFT), have been created to speed the computation. The two-dimensional DCT is useful in processing two-dimensional signals such as images.

The DCT equation 6.5 computes ith, jth entry of the DCT of an image.

Dept of IT, Dr AIT

Page 18

Jpeg Image compression and decompression

. . . . . . . 6.5

. . . . . . . . . . 6.6

P (x, y) is the xth, 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 6.7.

. . . . . . . 6.7

Because the DCT uses cosine functions, the resulting matrix depends on the horizontal and vertical 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 elements.

CHAPTER 7
Dept of IT, Dr AIT Page 19

Jpeg Image compression and decompression

METHODOLOGY
The process involves two parts one is compression and another one is decompression. In compression method we reduce the number of bits needed to represent the digital image by using Discrete Cosine Transform (DCT). In decompression we use Inverse DCT (IDCT) to reconstruct the image by reducing the actual size of image. 7.1 COMPRESSION 7.1.1 Block Diagram:

Input Image

Slice to 88 blocks

DCT Matrix

DCT

Quantiz ation

Zigzag coding

Entropy Coding

Compressed Image

Fig 7.1 Block Diagram to obtain compressed image The input is an image which consists of data in terms of pixels. A grayscale image is of resolution 255x255, i.e. it consists of 65025 no of pixel values. An 8x8 DCT matrix is considered here. 7.1.2 THE DCT MATRIX: To get the matrix form of Equation (1), we will use the following equation, Dept of IT, Dr AIT Page 20

Jpeg Image compression and decompression

Fig 7.2: a an 88 pixel block For an 8x8 block it results in this matrix:

magnification of used in DCT

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. Dept of IT, Dr AIT Page 21

Jpeg Image compression and decompression

7.1.3 DCT ON AN 8x8 BLOCK: Before we begin, it should be noted that the pixel values of a black-and-white image range from 0 to 255 in steps of 1, where pure black is represented by 0 and pure white by 255. Thus it can be seen how a photo, illustration, etc. can be accurately represented by these 256 shades of gray. Since an image comprises hundreds or even thousands of 8x8 blocks of pixels, the following description of what happens to one 8x8 block is a microcosm of the JPEG process; what is done to one block of image pixels is done to all of them, in the order earlier specified. Now, lets start with a block of image pixel values. This particular block was chosen from the very upper- left-hand corner of an image.

Dept of IT, Dr AIT

Page 22

Jpeg Image compression and decompression

Because the DCT is designed to work on pixel values ranging from -128 to 127, the original block is leveled off by subtracting 128 from each entry. This results in the following matrix. We are now ready to perform the Discrete Cosine Transform, which is accomplished by matrix multiplication. D = TMT ----- (5)

In Equation (5) matrix M is first multiplied on the left by the DCT matrix T from the previous section; this transforms the rows. The columns are then transformed by multiplying on the right by the transpose of the DCT matrix. This yields the following matrix.

This block matrix now consists of 64 DCT coefficients, c (i, j), where i and j range from 0 to 7. The top-left coefficient, c (0, 0), correlates to the low frequencies of the original image block. As we move away from c(0,0) in all directions, the DCT coefficients correlate to higher and higher frequencies of the image block, where c(7, 7) corresponds to highest frequency. Higher frequencies are mainly represented as lower number and Lower frequencies as higher number. It is important to know that human eye is most sensitive to lower frequencies.

Dept of IT, Dr AIT

Page 23

Jpeg Image compression and decompression

7.1.4 QUANTIZATION: Our 8x8 block of DCT coefficients is now ready for compression by quantization. A remarkable and highly useful feature of the JPEG process is that in this step, varying levels of image compression and quality are obtainable through selection of specific quantization matrices. This enables the user to decide on quality levels ranging from 1 to 100, where 1 gives the poorest image quality and highest compression, while 100 gives the best quality and lowest compression. As a result, the quality/compression ratio can be tailored to suit different needs. Subjective experiments involving the human visual system have resulted in the JPEG standard quantization matrix. With a quality level of 50, this matrix renders both high compression and excellent decompressed image quality.

If, however, another level of quality and compression is desired, scalar multiples of the JPEG standard quantization matrix may be used. For a quality level greater than 50 (less compression, higher image quality), the standard quantization matrix is multiplied by (100-quality level)/50.

Dept of IT, Dr AIT

Page 24

Jpeg Image compression and decompression

Fig 7.3 Same image compressed under a variety of quantization matrices For a quality level less than 50 (more compression, lower image quality), the standard quantization matrix is multiplied by 50/quality level. The scaled quantization matrix is then rounded and clipped to have positive integer values ranging from 1 to 255. For example, the following quantization matrices yield quality levels of 10 and 90.

Dept of IT, Dr AIT

Page 25

Jpeg Image compression and decompression

Quantization is achieved by dividing each element in the transformed image matrix D by corresponding element in the quantization matrix, and then rounding to the nearest integer value. For the following step, quantization matrix Q50 is used.

Dept of IT, Dr AIT

Page 26

Jpeg Image compression and decompression

Recall that the coefficients situated near the upper-left corner correspond to the lower frequencies to which the human eye is most sensitive of the image block. In addition, the zeros represent the less important, higher frequencies that have been discarded, giving rise to the lossy part of compression. As mentioned earlier, only the remaining nonzero coefficients will be used to reconstruct the image. It is also interesting to note the effect of different quantization matrices; use of Q10 would give C significantly more zeros, while Q90 would result in very few zeros. 7.1.5 ZIGZAG CODING: The quantized matrix C is now ready for the final step of compression. Before storage, all coefficients of C are converted by an encoder to a stream of binary data (01101011...). In-depth coverage of the coding process is beyond the scope of this article. However, we can point out one key aspect that the reader is sure to appreciate. After quantization, it is quite common for most of the coefficients to equal zero. JPEG takes advantage of this by encoding quantized coefficients in the zigzag sequence shown in Figure as under. The advantage lies in the consolidation of relatively large runs of zeros, which compress very well. The sequence in Figure 7.4 (4x4) continues for the entire 8x8 block.

Dept of IT, Dr AIT

Page 27

Jpeg Image compression and decompression

Fig 7.4 Zigzag coding on 88 quantized matrix 7.1.6 ENTROPY ENCODER: This is the last component in the compression model. Till now, we have devised models for an alternate representation of the image, in which its interpixel redundancies were reduced. This last model, which is a lossless technique, then aims at eliminating the coding redundancies, whose notion will be clear by considering an example. Suppose, we have a domain in an image, where pixel values are uniform or the variation in them is uniform. Now one requires 8 bpp (bits per pixel) for representing each pixel since the values range from 0 to 255. Thus representing each pixel with the same (or constant difference) value will introduce coding redundancy. This can be eliminated, if we transform the real values into some symbolic form, usually a binary system, where each symbol corresponds to a particular value. We will discuss a few coding techniques and analyze their performances.

7.2 DECOMPRESSION: Dept of IT, Dr AIT Page 28

Jpeg Image compression and decompression

7.2.1 Block diagram:

COMPRESSED IMAGE DATA

DECODING

DEQUANTIZAT ION

INVERSE DCT

ORIGINAL INPUT DATA

Fig 7.5 Block diagram to obtain decompressed image Reconstruction of our image begins by decoding the bit stream representing the Quantized matrix C. Each element of C is then multiplied by the corresponding element of the quantization matrix originally used R i, j = Q i, j C i, j

Dept of IT, Dr AIT

Page 29

Jpeg Image compression and decompression

The IDCT is next applied to matrix R, which is rounded to the nearest integer. Finally, 128 is added to each element of that result, giving us the decompressed JPEG version N of our original 8x8 image block M. N = round (TRT) + 128 7.3 PROPERTIES OF DCT: Some properties of the DCT which are of particular value to image processing applications: 1. Decorrelation: The principle advantage of image transformation is the removal of redundancy between neighboring pixels. This leads to uncorrelated transform coefficients which can be encoded independently. It can be inferred that DCT exhibits excellent decorrelation properties. 2. Energy Compaction: Efficacy of a transformation scheme can be directly gauged by its ability to pack input data into as few coefficients as possible. This allows the quantizer to discard coefficients with relatively small amplitudes without introducing visual distortion in the reconstructed image. DCT exhibits excellent energy compaction for highly correlated images. Dept of IT, Dr AIT Page 30

Jpeg Image compression and decompression

3. Separability: The DCT transform equation can be expressed as

This has the principle advantage that D (i, j) can operations on rows and columns of applied for the inverse DCT computation.

property, known as separability, be computed in two steps by successive 1-D an image. The arguments presented can be identically

4. Symmetry: Another look at the row and column operations in above Equation reveals that these operations are functionally identical. Such a transformation is called a symmetric transformation. A separable and symmetric transform can be expressed in the form D = TMT Where M is an N N symmetric transformation matrix This is an extremely useful property since it implies that the transformation matrix can be precomputed offline and then applied to the image thereby providing orders of magnitude improvement in computation efficiency.

Dept of IT, Dr AIT

Page 31

Jpeg Image compression and decompression

7.4 COMPARISON OF MATRICES: Let us now see how the JPEG version of our original pixel block compares, 7.5 FLOW CHART: START

Read the Real Time Image from the Specified Directory and Display the Image

Test for RGB Image

If the input image is color image

Image compression for color image with 'uint8'

Image compression for color image with 'uint16'

Image compression for color image with 'double'

Dept of IT, Dr AIT

Page 32

Jpeg Image compression and decompression

Yes

Dept of IT, Dr AIT

Page 33

Jpeg Image compression and decompression

if the input image is gray scale image

Image compression for gray scale image with 'uint8'

Image compression for gray scale image with 'uint16'

Image compression for gray scale image with 'double'

STOP

Dept of IT, Dr AIT

Page 34

Jpeg Image compression and decompression

7.6 CONCLUSION: If we look at the above two matrices, this is a remarkable result, considering that nearly 70% of the DCT coefficients were discarded prior to image block decompression/reconstruction. Given that similar results will occur with the rest of the blocks that constitute the entire image, it should be no surprise that the JPEG image will be scarcely distinguishable from the original. Remember, there are 256 possible shades of gray in a black-and-white picture, and a difference of, say, 10, is barely noticeable to the human eye. DCT takes advantage of redundancies in the data by grouping pixels with similar frequencies together. And moreover if we observe as the resolution of the image is very high, even after sufficient compression and decompression there is very less change in the original and decompressed image. Thus, we can also conclude that at the same compression ratio the difference between original and decompressed image goes on decreasing as there is increase in image resolution.

Dept of IT, Dr AIT

Page 35

Jpeg Image compression and decompression

CHAPTER 8 IMAGE COMPRESSION USING GAUSSIAN PYRAMID METHOD


The data structure used to represent image information can be critical to the successful completion of an image processing task. One structure that has attracted considerable attention is the image pyramid. This consists of a set of low pass or band pass copies of an image, each representing the pattern information of different scale. Here we describe Gaussian pyramid method that has been used for image data compression, enhancement, analysis and graphics. 8.1 Image pyramids The task of detecting a target pattern that may appear at any scale can be approached in several ways. Two of these, which involve only simple convolutions several copies of the pattern can be constructed at increasing scales, then each is convolved with the image. Alternatively, a pattern of fixed size can be convolved with several copies of the image represented at correspondingly reduced resolutions. The two approaches yield equivalent results, provided critical information in the target pattern is adequately represented. However, the second approach is much more efficient: a given convolution with the target pattern expanded in scale by a factor s will require s4 more arithmetic operations than the corresponding convolution with the image reduced in scale by a factor of s. This can be substantial for scale factors in the range 2 to 32, a commonly used range in image analysis. The image pyramid is a data structure designed to support efficient scaled convolution through reduced image representation. It consists of a sequence of copies of an original image in which both sample density and resolution are decreased in regular steps. An example is shown in Fig. 2a. These reduced resolution levels of the pyramid are themselves obtained through a highly efficient iterative algorithm. The bottom, or zero level of the pyramid, G0, is equal to the original image. This is low pass- filtered and sub sampled by a factor of two to obtain the next pyramid level, G1. G1 is then filtered in the same way and sub sampled to obtain G2. Further repetitions of the filter/subsample steps generate the remaining pyramid levels. To be precise, the levels of the pyramid are obtained iteratively as follows. For 0 < l < N Gl (i,j) SS\m n w (m,n) Gl-1 (2i+m,2j+n) :(1) Dept of IT, Dr AIT Page 36

Jpeg Image compression and decompression

However, it is convenient to refer to this process as a standard reduce operation, and simply write Gl = reduce [Gl-1]. We call the weighting function w(m,n) as the "generating kernel." For reasons of computational efficiency this should be small and separable. A five-tap filter was used to generate the pyramid in Fig.8.1.

Fig 8.1: A five-tap filter was used to generate the pyramid

Pyramid construction is equivalent to convolving the original image with a set of Gaussianlike weighting functions. These "equivalent weighting functions" for three successive pyramid levels are shown in Fig. 3a. Note that the functions double in width with each level. The convolution acts as a low pass filter with the band limit reduced correspondingly by one octave with each level. Because of this resemblance to the Gaussian density function we refer to the pyramid Band pass, rather than low pass, images are required for many purposes. These may be obtained by subtracting each Gaussian (low pass) pyramid level from the next lower level in the pyramid. Because these levels differ in their sample density it i s necessary to interpolate new sample values between those in a given level before that level is subtracted from the next-lower level. Interpolation can be achieved by reversing the reduce process. We call this an expand operation. Dept of IT, Dr AIT Page 37

Jpeg Image compression and decompression

Let Gl,k be the image obtained by expanding Gl k times. Then Gl,k = EXPAND [G Gl,k-1] or, to be precise, Gl,0 = Gl, and for k>0, of low pass images as the "Gaussian pyramid." Gl,k(i,j) = 4mnGl,k-1((2i+m)/2, (2j+n)/2) Here only terms for which (2i+m)/2 and (2j+n)/2 are integers contribute to the sum. The expand operation doubles the size of the image with each iteration, so that Gl,1, is the size of Gl,1, and Gl,1 is the same size as that of the original image. Examples of expanded Gaussian pyramid levels are shown in Fig. 8.2.

Fig 8.2 Levels of the Gaussian pyramid expanded to the size of the original image. The levels of the band pass pyramid, L0, L1, ...., LN, may now be specified in terms of the low pass pyramid levels as follows: Ll = GlEXPAND [Gl+1 = GlGl+1,1. Just as the value of each node in the Gaussian pyramid could have been obtained directly by convolving a Gaussian like equivalent weighting function with the original image, each value of this band pass pyramid could be obtained by convolving a difference of two Gaussians with the original image.

Dept of IT, Dr AIT

Page 38

Jpeg Image compression and decompression

Fig 8.3 Levels involved in Gaussian pyramid method

8.2 FLOW CHART: START

Dept of IT, Dr AIT

Read the Image from the Specified Directory and Display the Image

Page 39

Jpeg Image compression and decompression

If the input image is gray scale image

B
Image compression for gray image If the Low-pass filter the image input image is Down sampling the image color Save image image Image reconstructionfor color image Image compression for gray scale

Up sampling the image Low pass filter the image Low-pass filter the image Down sampling the image Save image

Image reconstruction for color image Up sampling the image Low pass filter the image
low-pass filter the image

Display the output image Dept of IT, Dr AIT Page 40

STOP

Jpeg Image compression and decompression

8.3 CONCLUSIONS The pyramid offers a useful image representation for a number of tasks. It is efficient to compute: indeed pyramid filtering is faster than the equivalent filtering done with a fast Fourier transform. The information is also available in a format that is convenient to use, since the nodes in each level represent information that is localized in both space and spatial frequency. Dept of IT, Dr AIT Page 41

Jpeg Image compression and decompression

We have discussed a number of examples in which the pyramid has proven to be valuable. Substantial data compression (similar to that obtainable with transform methods) can be achieved by pyramid encoding combined with quantization and entropy coding. Tasks such as texture analysis can be done rapidly and simultaneously at all scales. Several different images can be combined to form a seamless mosaic, or several images of the same scene with different planes of focus can be combined to form a single sharply focused image. Because the pyramid is useful in so many tasks, we believe that it can bring some conceptual unification to the problems of representing and manipulating low-level visual information. It offers a flexible, convenient multiresolution format that matches the multiple scales found in the visual scenes and mirrors the multiple scales of processing in the human visual system.

CHAPTER 9 SOFTWARE DESCRIPTION 9.1 MATLAB


MATLAB is a high-level technical computing language and interactive environment for algorithm development, data visualization, data analysis, and numeric computation. 9.1.1 Key Features: Dept of IT, Dr AIT Page 42

Jpeg Image compression and decompression

1. High-level language for technical computing 2. Development environment for managing code, files, and data 3. Interactive tools for iterative exploration, design, and problem solving 4. Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, and numerical integration 5. 2-D and 3-D graphics functions for visualizing data 6. Tools for building custom graphical user interfaces
7. Functions for integrating MATLAB based algorithms with external applications and

languages, such as C, C++, FORTRAN, Java, etc. Programming and development is faster because you do not need to perform low-level administrative tasks, such as declaring variables, specifying data types, and allocating memory. 9.1.2 Image Processing in Mat lab: Images can be conveniently represented as matrices in Mat lab. The matrix may simply be m x n form or it may be 3 dimensional arrays or it may be an indexed matrix, depending upon image type. The image processing may be done simply by matrix calculation or matrix manipulation. 9.1.3 Mat lab as a tool for data analysis: A mathematical term for a table is a matrix. (From now on you can understand the term matrix as table.) Mat lab deals with matrices very well. Lets create a matrix of ones in Mat lab. To do this, we need to know how many rows and columns we want in a matrix. Suppose we want to create a matrix of ones with 2 rows and 3 columns. To do this, type ones(2,3). The Mat lab will return Ans = 1 1 1 1 1 1

Suppose we want to store this matrix in a variable. To do this, type M=ones (2, 3). Now, M will appear in the Workspace window (notice that its size, 2 by 3, is also stated). The size of a Dept of IT, Dr AIT Page 43

Jpeg Image compression and decompression

matrix is often referred to as its dimensions. For example, M is a matrix of dimensions 2 by 3 or simply a 2 by 3 matrix. Whenever you want to change a variable or remove a variable, you can use command clear. If you type clear M, this will remove M from the Workspace. Try it. Anytime if you have made a mistake defining a variable or a function, or when you reuse the same variable name, it is a very good practice to use the clear command. If you want to get rid of all the variables in your Workspace, you can simply type clear. You can also construct your own matrix by typing it in. For example, if you type M= [2,5;9,7; 4,3], you will get a 3 by 2 matrix: 2 9 4 5 7 3

As you can see, to define a matrix in Mat lab, you surround the entries by square brackets. Commas separate column entries and semicolons separate row entries. To look at the whole first row of the matrix M, you type M (1,:). Here, the colon means show me all the entries in the row(s) indicated. To look at the whole second column, you type M (:,2). If you want to see only the second and third rows of M, you type M (2:3,:).

9.1.4 Saving workspace and plots: Now that youve done all this work, you might want to save it. To save all the variables that you have created, you need to save your Workspace. To do this, type save workspace name (you can pick the name). After you close Mat lab, you can open that file and it will contain all the variables that you have created. You can also save selected variables. For example to save variable data1 only, type save data name data1.

Dept of IT, Dr AIT

Page 44

Jpeg Image compression and decompression

This will create another data_name.mat file that will contain only variable data1. You might also want to save your plots. There are two ways of saving Mat lab plots. One of them saves them in the Mat lab format .fig. This allows you to open the figure later in Mat lab and make modifications to it (change axes, add text, etc.). To save a figure like that, simply click on the File heading on the toolbar on top of the figure window and click Save. You can also save files in other graphical formats. To do this, go to the File heading on the toolbar of the figure window and click Export. This allows you to export your file in several formats (most familiar would probably be .jpg). This is useful for saving your completed plots for reports. 9.1.5 SolvLab: a tool for solving differential equations: In this course, you will have to use Mat lab to solve difference and differential equations numerically. To do this, you will use a tool that will make doing this easier. Its called SolvLab. It allows you to define and solve systems of differential and difference equations. The problem involves numerically solving a continuous-time logistic model:

Where N is the number of individuals in a population, r is the growth rate of a population at low densities and K is the carrying capacity of the environment.

10. REAL IMAGE

WORLD APPLICATIONS OF COMPRESSION

The many benefits of image compression include less required storage space, quicker sending and receiving of images, and less time lost on image viewing and loading. 1. Telecommunication Industries

Dept of IT, Dr AIT

Page 45

Jpeg Image compression and decompression

Just as image compression has increased the efficiency of sharing and viewing personal images, it offers the same benefits to just about every industry in existence. Early evidence of image compression suggests that this technique was, in the beginning, most commonly used in the printing, data storage, and telecommunications industries. Today however, the digital form of image compression is also being put to work in industries such as fax transmission, satellite remote sensing, and high definition television, to name but a few. 2. Health Industry In certain industries, the archiving of large numbers of images is required. A good example is the health industry, where the constant scanning and/or storage of medical images and documents take place. Image compression offers many benefits here, as information can be stored without placing large loads on system servers. Depending on the type of compression applied, images can be compressed to save storage space, or to send to multiple physicians for examination. And conveniently, these images can uncompress when they are ready to be viewed, retaining the original high quality and detail that medical imagery demands. 3. Federal Government Agency Image compression is also useful to any organization that requires the viewing and storing of images to be standardized, such as a chain of retail stores or a federal government agency. In the retail store example, the introduction and placement of new products or the removal of discontinued items can be much more easily completed when all employees receive, view and process images in the same way. Federal government agencies that standardize their image viewing, storage and transmitting processes can eliminate large amounts of time spent in explanation and problem solving. The time they save can then be applied to issues within the organization, such as the improvement of government and employee programs. 4. Security Industry In the security industry, image compression can greatly increase the efficiency of recording, processing and storage. However, in this application it is imperative to determine whether one compression standard will benefit all areas. For example, in a video networking or closed-circuit television application, several images at different frame rates may be required. Time is also a consideration, as different areas may need to be recorded for various lengths of time. Dept of IT, Dr AIT Page 46

Jpeg Image compression and decompression

Image resolution and quality also become considerations, as does network bandwidth, and the overall security of the system. 5. Museums and galleries Museums and galleries consider the quality of reproductions to be of the utmost importance. Image compression, therefore, can be very effectively applied in cases where accurate representations of museum or gallery items are required, such as on a Web site. Detailed images that offer short download times and easy viewing benefits all types of visitors, from the student to the discriminating collector. Compressed images can also be used in museum or gallery kiosks for the education of that establishments visitors. In a library scenario, students and enthusiasts from around the world can view and enjoy a multitude of documents and texts without having to incur traveling or lodging costs to do so.
6. Discrete Cosine Transform data compression applied to satellite sensor images.

Images are now widely available in the form of digital data. Unfortunately the amount of data that results from the digitization process is extremely large, resulting in high costs in terms of storage demand or transmission bandwidth for such data. Image data compression techniques are becoming widely used in order to reduce these problems, a standard technique being the DCT. Significant compression ratios are achievable using the DCT (typically 20:1), but with the drawback of some loss of accuracy in the decompressed reconstructed image. Regardless of industry, image compression has virtually endless benefits wherever improved storage, viewing and transmission of images are required. And with the many image compression programs available today, there is sure to be more than one that fits your requirements best.

11. ADVANTAGES AND DISADAVNTAGES


11.1 ADVANTAGES OF DCT
1. The first main advantage of the DCT is its efficiency. As the size of the image to be

produced increases, the FFT becomes increasingly complex at a much more rapid rate, and is not efficient for compression. Instead, in transforming to the frequency domain, a type of

Dept of IT, Dr AIT

Page 47

Jpeg Image compression and decompression

DCT called the Blocked DCT is used, which performs the same task in a more efficient manner.
2. Another advantage of the DCT is that its basis vectors are comprised of entirely real-valued

components. Therefore, in terms of image compression, all pixel values are automatically represented by real numbers. In addition, the pixels themselves do not affect each other. In Fourier analysis, one of the disadvantages is that every pixel affects every other pixel, but if better job of concentrating energy into the DCT is used instead of the DFT, values of the pixels come directly from the transform of the time domain value. 3. The DCT does a b lower order coefficients than does the DFT for image data 4. The DCT is purely real, the DFT is complex 11.2 DISADVANTAGES OF DCT
1. Assuming a periodic input, the magnitude of the DFT coefficients is spatially invariant

.This is not true for the DCT. 2. Only spatial correlation of the pixels inside the single 2-D block is considered and the correlation from the pixels of the neighboring blocks is neglected
3. Impossible to completely decor relate the blocks at their boundaries using DCT

4. Undesirable blocking artifacts affect the reconstructed images or video frames. (high compression ratios or very low bit rates)

12. FUTURE ENHANCEMENTS


It can be used as the natural technology for handling the increased spatial resolution of todays imaging sensors.

It plays a major role in tele-video conferencing, remote sensing and medical imaging. It can be used to control the remotely piloted vehicles in military, space and hazardous waste management applications.

Dept of IT, Dr AIT

Page 48

Jpeg Image compression and decompression

In the future, efficient utilization of image processing capabilities in the service of plastic surgery will be achieved by the emerging capabilities for many complicated procedures. These include huge image data base processing, automatic detection of pathologic cases by enhancement of details and recognition of patterns, accurate measurements of the changes and distortions in the processed images, prediction of results to allow planning of treatment, simulation, and training on computerized cases.

The new capabilities also include visual control of robotic arms for complicated operations, better audio-visual communication between faraway clinics and medical centers via sophisticated teleconferencing systems--which will save traveling expenses and time and will enable the updating of medical information--and many more applications that will be developed when the basic equipment becomes an integrated part of the clinics and plastic surgery departments.

Future image processing will enhance the visual aspect in the plastic surgeon's work and will enable the doctor to expand his or her professional capabilities.

13. IMAGE COMPRESSION RESULTS 13.1 GAUSSIAN PYRAMID METHOD:


13.1.1 Gray Scale Image

Dept of IT, Dr AIT

Page 49

Jpeg Image compression and decompression

Input Image Size: 404kb

Reconstructed Image Size: 268kb

Dept of IT, Dr AIT

Page 50

Jpeg Image compression and decompression

Level 1 Size: 92.6kb

Level 2 Size: 27.9kb

Level 3 Size: 9.76kb

13.1.2 Color Image

Input Image Size: 329Kb

Reconstructed Image Size: 95.4Kb

Dept of IT, Dr AIT

Page 51

Jpeg Image compression and decompression

Level 1 Size: 45.2kb

Level 2 Size: 15.2kb

Level 3 Size: 4.41kb

13.2 DCT METHOD


13.2.1 Color Image

Dept of IT, Dr AIT

Page 52

Jpeg Image compression and decompression

Input Image Size 329 Kb

Decompressed Image Size 194 Kb 13.2.2 Gray Scale Image

Dept of IT, Dr AIT

Page 53

Jpeg Image compression and decompression

Input Image Size 404 Kb

Reconstructed Image Size 238 Kb

14. CONCLUSION

Dept of IT, Dr AIT

Page 54

Jpeg Image compression and decompression

From above examples it is clear that Image compression using Discrete Cosine Transform (DCT) produces a good clarity image. Even though there is a loss in information the output Image looks similar to the input image. Human eyes cannot make out the loss of information. Also DCT reduces the memory required to store the image without altering the dimension of the image. The Gaussian pyramid method produces an output image whose clarity is reduced compared to original image. Even though the memory required to save image is reduced the clarity will not be the same as input image. Also the dimension of the output image i.e. Reconstructed image is reduced compared to the dimension of original image. DCT takes the advantage of redundancies in the data by grouping pixels with similar frequencies together and more over if we observe as the resolution of the image is very high even after sufficient compression and decompression there is very less change in the original and decompressed image. Thus we can also conclude that at the same compression ratio the difference between the original and decompressed image goes on decreasing as there is increase in image resolution Furthermore, it does not require a lot of information about the image that will be submitted. In terms of execution time, the approaches do not exceed a little dozens of seconds, which an average time of 13 seconds to DCT method. The tested images do not exceed the 29x29 dimension, but it is expected that the algorithm does not become expensive in term of execution time, since the most of satellite images are commonly bigger than that. In terms of computational costs, the use of DCT is not expensive, so we believe that the DCT method represents a novel approach to segmentation task, covering a lot of images with a wider range of randomness. The future works are focused on DCT method enhancement. It is expected that the thresholds being automatically selected according to the classes features in an image. In addition, other thresholds may be introduced to improve the method accuracy, beyond the development of an unsupervised classifier to complete the image analysis.

15. REFERENCES
[1] CHEN, Y.-L.; CHEN, T.-W.; CHIEN, S.-Y. Fast texture feature extraction method based on

Dept of IT, Dr AIT

Page 55

Jpeg Image compression and decompression

Segmentation for image retrieval. In: IEEE 13th International Symposium on Consumer Electronics. [S.l.: s.n.], 2009. p. 941942. [2]Yushin Cho, W. A. Pearlman, A. Said, Low complexity resolution progressive image coding algorithm: PROGRES (Progressive Resolution Decompression), in Proc. IEEE International Conference on Image Processing, September 2005. [3] J. Oliver, M. P. Malumbres, Fast and efficient spatial scalable image compression using wavelet lower trees, in Proc. IEEE Data Compression Conference, Snowbird, UT, March 2003. [4] C. Chrysafis, A. Said, A. Drukarev, A. Islam, W. A. Pearlman, SBHP- A low complexity wavelet coder, in Proc. IEEE Int. Conference on Acoustics, Speech, and Signal Processing, 2000. [5] Digital Image Processing, Rafael C. Gonzalez, Richard E. Woods, November 2001 Web sites:

The Mathworks (company that release Mat lab) documentation website: http://www.mathworks.com/access/helpdesk/help/helpdesk.shtml

Mat lab Help Desk online: http://www-ccs.ucsd.edu/matlab/ http://www.jpeg.org http://cnx.rice.edu http://www.datacompression.info http://www.cs.sfu.ca http://www.wikipedia.org

Dept of IT, Dr AIT

Page 56

You might also like