Вы находитесь на странице: 1из 16

Visit: www.geocities.com/chinna_chetan05/forfriends.

html

Title : A Wavelet based Image Compression Technique

Index terms
Image compression, Discrete wavelet transform, Sub band
decomposition, Entropy coding, Quantization, Decoder.

1.0 INTRODUCTION
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 a 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

1 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

2.0 Image
In general images can be defined as any two dimensional function that bears
information can be considered an image
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
2.1 Image types
. The different types of images are binary, indexed, intensity, and RGB
image types.
2.1.1 Binary image
An image containing 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.
2.1.2 Indexed image
An image whose 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 m-by-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.
2.1.3 Intensity image
An image consisting 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

2 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

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."
2.1.4 Multiframeimage
An image file that 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
"multipageimage."

2.1.5 RGB image


An image in which 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.0 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.
Data compression seeks to minimize this cost and sometimes try to
reduce the bandwidth of the digital signal below its analog bandwidth
requirements.

3.1 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

3 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

Table 1 Multimedia data types and uncompressed storage space required

Bits/Pixel or Uncompressed
Multimedia Data Size/Duration
Bits/Sample Size
A page of text 11'' x 8.5'' Varying resolution 16-32 Kbits
Telephone quality
1 sec 8 bps 64 Kbits
speech
Grayscale Image 512 x 512 8 bpp 2.1 Mbits
Color Image 512 x 512 24 bpp 6.29 Mbits
Medical Image 2048 x 1680 12 bpp 41.3 Mbits
SHD Image 2048 x 2048 24 bpp 100 Mbits
640 x 480, 10
Full-motion Video 24 bpp 2.21 Gbits
sec

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

4.0 What are the different types of compression?


(A) 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-
by-pixel 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).

(B) Predictive vs. Transform coding:

4 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

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 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.0 Block diagram of image compression

5 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

6.0 Image compression


6.1 Discrete wavelet transform
For a given image, you can compute the DWT of, say each row, and
discard all values in the DWT that are less then a certain threshold. We then
save only those DWT coefficients that are above the threshold for each row, and
when we need to reconstruct the original image, we simply pad each row with as
many zeros as the number of discarded coefficients, and use the inverse DWT to
reconstruct each row of the original image. We can also analyze the image at
different frequency bands, and reconstruct the original image by using only the
coefficients that are of a particular band

The DWT analyzes the signal at different frequency bands with different
resolutions by decomposing the signal into a coarse approximation and detail
information.DWT employs two sets of functions, called scaling functions and
wavelet functions, which are associated with low pass and high pass filters,
respectively. The decomposition of the signal into different frequency bands is
simply obtained by successive high pass and low pass filtering of the time
domain signal. The original signal x[n] is first passed through a half band high
pass filter g[n] and a low pass filter h[n]. After the filtering, half of the samples can
be eliminated according to the Nyquist’s rule, since the signal now has a highest
frequency of  /2 radians instead of . The signal can therefore be sub

6 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

sampled by 2, simply by discarding every other sample. This constitutes one


level of decomposition and can mathematically be expressed as follows:

where yhigh[k] and ylow[k] are the outputs of the high pass and lowpass filters,
respectively, after subsampling by 2. This decomposition halves the time
resolution since only half the number of samples now characterizes the entire
signal. However, this operation doubles the frequency resolution, since the
frequency band of the signal now spans only half the previous frequency band,
effectively reducing the uncertainty in the frequency by half. The above
procedure, which is also known as the subband coding, can be repeated for
further decomposition. At every level, the filtering and subsampling will result in
half the number of samples (and hence half the time resolution) and half the
frequency band spanned (and hence double the frequency resolution). Figure 4.1
illustrates this procedure, where x[n] is the original signal to be decomposed, and
h[n] and g[n] are lowpass and highpass filters, respectively. The bandwidth of the
signal at every level is marked on the figure as "f".

IMAGE DECOMPOSITION
7 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

Figure 4.1 SUB BAND CODING

As an example, suppose that the original signal x[n] has 512 sample points,
spanning a frequency band of zero to  rad/s. At the first decomposition level,
the signal is passed through the highpass and lowpass filters, followed by
subsampling by 2. The output of the highpass filter has 256 points (hence half
the time resolution), but it only spans the frequencies /2 to  rad/s (hence
double the frequency resolution). These 256 samples constitute the first level of
DWT coefficients. The output of the lowpass filter also has 256 samples, but it
spans the other half of the frequency band, frequencies from 0 to /2 rad/s. This
signal is then passed through the same lowpass and highpass filters for further
decomposition. The output of the second lowpass filter followed by subsampling
has 128 samples spanning a frequency band of 0 to /4 rad/s, and the output of
the second highpass filter followed by subsampling has 128 samples spanning a
frequency band of /4 to /2 rad/s. The second highpass filtered signal
constitutes the second level of DWT coefficients. This signal has half the time
8 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

resolution, but twice the frequency resolution of the first level signal. In other
words, time resolution has decreased by a factor of 4, and frequency resolution
has increased by a factor of 4 compared to the original signal. The lowpass filter
output is then filtered once again for further decomposition. This process
continues until two samples are left. For this specific example there would be 8
levels of decomposition, each having half the number of samples of the previous
level. The DWT of the original signal is then obtained by concatenating all
coefficients starting from the last level of decomposition (remaining two samples,
in this case). The DWT will then have the same number of coefficients as the
original signal

9 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

6.2 Quantizer
A quantizer simply reduces the number of bits needed to store the
transformed coefficients by reducing the precision of those values. Since this is a
many-to-one mapping, it's a lossy process and is the main source of
compression in an encoder. Quantization can be performed on each individual
coefficient, which is known as Scalar Quantization (SQ). Quantization can also
be performed on a group of coefficients together, and this is known as Vector
Quantization (VQ). Both, uniform and non-uniform quantizers can be used
depending on the problem at hand. The discrete wavelet coefficients is uniformly
quantized in conjunction with a carefully designed Quantization Table At the
decoder, the quantized values are multiplied by the corresponding Quantization
Table elements to recover the original unquantized values.

6.3 Entropy coding

The entropy of a source is defined as the average information generated by


the source. An entropy encoder further compresses the quantized values
losslessly to give better overall compression. Most commonly used entropy
encoders are the Huffman encoder and the Arithmetic encoder, although for
applications requiring fast execution, simple run-length coding has proven very
effective. After quantization, all of the quantized coefficients are ordered into the
"zigzag" sequence. This ordering helps to facilitate entropy coding by placing
low-frequency non-zero coefficients before high-frequency coefficients. The DC
coefficient, which contains a significant fraction of the total image energy, is
differentially encoded.
Entropy Coding (EC) achieves additional compression losslessly by encoding the
quantized DWT coefficients more compactly based on their statistical
characteristics. The JPEG proposal specifies both Huffman coding and
Arithmetic coding. The Baseline sequential codec uses Huffman coding, but
codec’s with both methods are specified for all modes of operation.

10 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

7.0 Reconstruction of the compressed image

7.1 Decoder

At the decoder, the quantized values are multiplied by the corresponding QT


elements to recover the original unquantized values.

7.2 Inverse discrete wavelet transform

One important property of the discrete wavelet transform is the


relationship between the impulse responses of the highpass and lowpass filters.
The highpass and lowpass filters are not independent of each other, and they are
related by

g [ L – 1 – n ]=( -1)n .h[n]

Where g[n] is the highpass, h[n] is the lowpass filter, and L is the filter length(in
number of points).Note that the two filters are odd index alternated reversed
versions of eachother . Low pass to high pass conversion is provided by the (-1) n
term. Filters satisfying this condition are commonly used in signal processing,

11 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

and they are known as the Quadrature Mirror Filters (QMF). The two filtering and
sub sampling operations can be expressed by

Yhigh [K] = ∑ x[ n ].g[ -n +2k ]

Ylow [k] = ∑ x[ n ].h[ -n+2k ]

The reconstruction in this case is very easy since half band filters form
orthonormal bases. The above procedure is followed in reverse order for the
reconstruction. The signals at every level are up sampled by two, passed through
the synthesis filters g’[n], and h’[n] (high pass and low pass, respectively), and
then added. The interesting point here is that the analysis and synthesis filters
are identical to each other, except for a time reversal. Therefore, the
reconstruction formula becomes (for each layer)

12 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

However, if the filters are not ideal half band, then perfect reconstruction cannot
be achieved. Although it is not possible to realize ideal filters, under certain
conditions it is possible to find filters that provide perfect reconstruction. The
most famous ones are the ones developed by Ingrid Daubechies, and they are
known as Daubechies’ wavelets.

8.0 Advantages of discrete wavelet transform

Since the input image needs to be blocked in DCT based compression


method, the correlation across the block boundaries is not eliminated resulting in
noticeable and annoying "blocking artifacts" particularly at low bit rates. Since
there is no need to block the input image and its basis functions have variable
length, wavelet coding schemes at higher compression avoid blocking artifacts.

13 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

Fig.8 (a) Original Lena Image, and (b) Reconstructed Lena with DC
component only, to show blocking artifacts
Wavelet -based coding is more robust under transmission and decoding errors,
and also facilitates progressive transmission of images. In addition, they are
better matched to the HVS characteristics as well. Because of the inherent multi
resolution nature, wavelet coding schemes are especially suitable for
applications where scalability and tolerable degradation are important.

9.0 Results

14 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

We have developed an algorithm for compression of the joint


photographic expert group images in ‘C’ language and we had succeeded in
achieving our target. And we have tested our algorithm and compressed the
images to the maximum extent that is the compression ratio of 25:1 and
succeeded in reconstructing those compressed images.

Here we had given the aishwarya image before and after compression.
10.0 Conclusions
Wavelet-based coding provides substantial improvement in picture
quality at low bit rates due to overlapping basis functions and better energy
compaction property of wavelet transforms. Because of the inherent
multiresolution nature, wavelet-based coders facilitate progressive transmission
of images thereby allowing to achieve variable bit rates. And the future work of us
is to modify the algorithm now which we are using in order to achieve a high
compression ratio of 300:1.
11.0 References

15 Email: chinna_chetan05@yahoo.com
Visit: www.geocities.com/chinna_chetan05/forfriends.html

1. Image processing, analysis, and machine vision by Milan sonka second


edition
2. Digital image processing by anil k. jain
3. Digital signal processing by venkataramani
4. Claypoole, R., Davis, G., Sweldens, W., and Baraniuk, R. Nonlinear
Wavelet Transforms for Image Coding, Proceedings of the 31st Asilomar
Conference on Signals, Systems, and Computers, Volume 1, pp 662-
667, 1997, [URL http://cm.bell-labs.com/who/wim/papers/asil97.pdf ].
5. Antonini, M., Barlaud, M., Mathieu, P., and Daubechies, I. Image Coding
Using Wavelet Transform, IEEE Trans. IP, vol. 1 No. 2, April 1992, pp.
205-220.

11.1 Websites

1. www.google.com
2. www.groups.google.com
3. www.array.com
4. www.mathworks.com
5. http://cm.bell-labs.com/who/jelena/Book/home.html

16 Email: chinna_chetan05@yahoo.com

Вам также может понравиться