fast image compression using dic algorithm

Upload: venkateshmukharji

Post on 08-Aug-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    1/21

    FAST IMAGE COMPRESSION USING DIC

    ALGORITHM(EMBEDDED ZEROTREE WAVELET TRANSFORM)

    Presented ByP.Anandakrishnan.

    &K.Arun.

    INSTITUTE OF ROAD AND TRANSPORT TECHNOLOGY

    ERODE-638316

    Contact Address:K.Arun

    Pre-Final Yr, ECE

    IRTT, Vasavi College Post,

    Erode-638316.

    E-Mail Address:

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    2/21

    ABSTRACT

    This paper aims at providing an efficient solution for image compression

    technique using Embedded Zerotree wavelet coding. The quality of compression lies

    only in the selection of wavelet filter and the decomposition level. The Embedded

    Zerotree Wavelet comprises of both the quantization and encoding. As both the

    processes are carried out in short time the reliability in compressing an image will be

    high by Fast Image Compression Technique. Since the truncation of the redundant

    data there is no any notable difference between the original image and synthesized image .

    This algorithm is not much complex and the memory required to implement the

    algorithm is not very high. With a strong mathematical background and quantitative

    analysis, it provides a promising method DIC algorithm, which would enable efficient

    compression in the growing trends. The compression using this algorithm can compress

    32 bit data (16 million colors) and can give compression ratios of approximately 20:1

    without any noticeable image distortion or even 100:1, but with some image distortion.

    The above said algorithm has been simulated and implemented for the verification in the

    platforms ofMATLAB and C.

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    3/21

    INTRODUCTION: Everyday, an enormous amount of information is stored, processedand transmitted digitally. Because much of this information is graphical or pictorial in

    nature the storage and communications requirements are immense. For example in order

    to digitally represent 1 second of video without compression (using CCIR 601 format ),

    we need more than 20 megabytes, or 160 megabits. Therefore methods of compressing

    the data prior to storage or transmission are of significant practical and commercial

    interest. Data compression are used to reduce the number of bits required to represent animage. In brief, data compression is the art or science of representing information in a

    compact form. The concept of image compression reduces the burden of much storage

    space, large transmission bandwidths and long transmission times. Therefore, it is

    advantageous to compress the image by storing only the essential number of applications

    depend on the efficient manipulation, storage, and transmission of binary, graysacle, and

    colour images. Ours is a DIC Algorithm which works well on all form of pictures.

    Need for compression:

    An Image may be defined as a two dimensional function, f(x,y),

    where x and y are special Co-ordinates and the amplitude offat any pair of co-ordinates

    (x, y) are called the Intensity of the image at that point. When x, y and the amplitude

    values of f are all finite, discrete quantities we call the image a digital image .the digital

    image can be represented as a matrix consisting of N rows and M columns. Since image

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    4/21

    occupies much storage space and long transmission time, the only way currently to

    improve on these resource requirements to compress images, such that they can be

    transmitted quicker. Image compression address the problem of reducing the amount of

    data required to represent a digital image. The underlying basis of the reduction process

    is the removal of a redundant data. Redundancy reduction is aimed at removing

    duplication in the image. By removing the redundant data the image can be compressed

    in a smaller number of bits and hence can be compressed. From the mathematical

    viewpoint, this amount to transform a 2-Dpixel array into an uncorrelated data set. Then

    the compressed image is decompressed to reconstruct the original image or an

    approximation of it.

    compression Techniques:

    Compression techniques fall in two categories:

    1) Information preserving.

    2) Lossy.

    Lossless compression:

    They are particularly useful in image archiving. These methods allow

    an image to be compressed and decompressed without losing information.

    Lossy compression:

    They provide higher level of data reduction but result in a less than perfect

    reproduction of the original image. They are useful in applications such as broadcast

    television, video conferencing and

    facsimile transmission, in which a certain amount of error is an acceptable trade-off for

    increased compression performance performance.

    Coding:

    There are two types of coding, one is predictive coding and the other one is transform

    coding. When compared to predictive coding, the transform coding is more efficient.

    Transform coding on the other hand, first transforms the image from its spatial domain

    representation to a different type of represented using some well-known transform and

    then code the transformed values (coefficients). For most natural images significant

    number of co-efficient has small magnitudes and can be discarded entirely with little

    image distortion.

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    5/21

    Fundamentals of compression:

    In most cases the data provide either no relevant information or simply

    restate that which is already known, then it is said to contain data redundancy and it plays

    a vital role in image compression. If n1 and n2 denote the number of information

    carrying units in two data set that represents 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 Compression ratio is

    CR = n1/n2

    We have three cases

    Case1: For the first case n2=n1, CR=1, RD=0 indicating that first representation of the

    information contains no redundant data.

    Case2: When n21, implying significant compression and

    highly redundant data.

    Case3: Finally when n2>>n1, CR->0 and RD-> indicating that second data set

    contains much more data

    Than the original representation.

    Data redundancy:

    In digital image compression, there are three basic redundancies can be

    identified and exploited:

    Coding redundancy:

    If the gray levels of an image are coded in a way that use more code symbols

    than absolutely necessary to represent each gray level, the resulting image is said to

    contain codingredundancy.

    Interpixel redundancy:

    The difference between adjacent pixels can also be used to represent the

    image and this is called interpixel redundancy. Because much of the visual construction

    of a single pixel to an image is redundant; it could have been guessed on the basis of the

    values of its neighbors.

    Psycho visual redundancy:

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    6/21

    Certain information simply has less relative importance than other

    information in normal visual processing and this information is said to be psycho visual

    redundancy. It can be eliminated without significantly impairing the quality of image

    perception.

    Why do we go for transforms?

    Often signals we wish to process are process are in the time-domain, but in

    order to process them more easily other information, such as frequency is required.

    Mathematical transforms translate the information of signals into different

    representations. The signals are operated on this domain and this domain and then return

    to the original domain without losing any information.

    A signal can be analyzed in many ways. The way which is best suited depends on the

    type of transform involved. Let us see an overview each analysis.

    Fourier analysis:

    Signal anlysts already have at their disposal an impressive arsenal of tools.

    Perhaps the most well-known of these is Fourier analysis, which breaks down signal

    into constituent sinusoids of different frequencies. Another way to think of Fourier

    analysis is as a mathematical technique for transforming our view of the signal from

    time-based to frequency-based. Since Fourier transform are useful in providing good

    frequency information, it is used widely. But while transforming in Fourier transform, we

    will loose time information. This is the main drawback of using this transform. The

    reason is that we cannot know when these frequencies occur, so they are not much useful

    when both time and frequency information is required simultaneously.

    Short-Time Fourier Analysis:

    =

    t

    ftj

    X dtettwtxftSTFT 2*)( )]'()([),(

    In an effort to correct this deficiency, Dennis Gabor (1946) adopted the

    Fourier transform to analyze only a small section of the signal at a time a technique

    called Windowing the signal. Gabors adoption, called the Short-Time Fourier

    Transform (STFT), maps a signal into a two-dimensional function of time and

    frequency. The STFT represents a sort of compromise between the time and frequency

    based views of a signal.It gives some information about when and at what frequencies a

    signal event occurs. But we can obtain the information with less precision. This is due to

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    7/21

    the fact that the size of the window is fixed. There is only one enhancement in using this

    transform (i-e) the frequency and time are easily mapped. If the window is very wide,

    which makes the STFT approach the FT, we get very bad time resolution and very good

    frequency resolution. If the window is very narrow we get very good time resolution and

    very bad frequency resolution

    Narrow window Wide window

    Heisenbergs Uncertainty Principle:

    According to Heisenbergs Uncertainty principle it is impossible to know

    exactly what frequencies occur at what time, only range of frequencies can be found. This

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    8/21

    means trying to gain more detailed frequency information causes the time information to

    become less specific and vice versa. Therefore when using the STFT, there has to be a

    sacrifice of either time or frequency information. Having a big window gives good

    frequency resolution; small windows provide better time information, but poorer

    frequency information.

    Discrete Cosine transform:

    DCT-based encoder can be thought of as an essentially compression of a

    stream of 8x8 blocks of image samples. Each 8x8 block makes its way through each

    processing step, and yields output in compressed form into

    the data stream. For decompression the inverse DCT is carried out. The main

    disadvantage of this transform is that the size of the window is not sizable.

    Continuous wavelet transform:

    == dt

    s

    ttx

    sssCWT xx

    *)(

    ||

    1),(),(

    In continuous wavelet transform we are going to take transform of the

    continuous time signal. While transforming we will split it into number of fragments

    called windows. The two main drawbacks for to why this transform is expelled out are:

    1. Redundancy of the CWT.

    2. For most of the functions there is no analytical solution.

    Discrete wavelet transforms:

    To reduce the computation a different strategy was discovered and it was

    named as Discrete Wavelet Transform. It turns out, rather remarkably, that if we choose

    scales and positions based on powers of two so called dyadic scales and positions

    then our analysis will be much more efficient and just as accurate. This is achieved using

    Discrete Wavelet Transform. This very practical filtering algorithm yields a Fast Wavelet

    Transform.

    Image compression techniques:

    In order to compress an image, the decomposition level, the type of transform to

    carry out compression and the type of filter used for taking transform are needed.

    Selection of image:

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    9/21

    An image of a Facet (256 x 256) is taken. Compression of that image is carried out

    at the fore-coming steps. First the image is transformed to wavelet co-efficient by using

    efficient filters. At the time of taking transform the decomposition level is more

    important. The decomposition level only determines the quality of the image after

    compression.

    Decomposition:

    Selection of wavelet:

    Several different criteria can be used in selecting an optimal wavelet

    function. The objective is to minimize reconstructed error variance and maximize signal

    to noise ratio. In general optimal wavelet can be selected based on the energy

    conservation properties in the approximation part of the wavelet co-efficient. Wavelets

    with more vanishing moments provide better reconstruction quality. Haar wavelet is the

    only wavelet which has more advantage over image compression. Hence haar wavelet is

    chosen.

    Fast wavelet transform implementation:

    The DWT is implemented using a filter bank structure. The input sequence is

    decomposed into two subsequences by passing it through a low pass filter and a high pass

    filter and downsampling the output of the filter by 2. the low and high pass filters are half

    band filters called the conjugate quadratic filters(CQF), related by

    G[n]=(-1)n h[L-1-n]

    Where g[n] is the LP filter and L is the filter length and is even. Thus the two

    subsequences obtained belong to the LP and HP pass bands respectively. The filtering

    increases the frequency resolution by 2 and the sub sampling reduces the time resolution

    by 2. This process is iterated on the LP branch to obtain finer frequency resolution at

    lower frequencies.

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    10/21

    What wavelet actually does:

    At first the wavelet transform is applied to the entire input image and its

    coefficients are determined. Since image is a 2-D functions a two-dimensional scaling

    function, (x , y), and three dimensional wavelets, h (x , y), v (x , y) and d (x ,

    y) are required. Each is a product of a one-dimensional wavelets, and corresponding

    wavelet . Excluding the product that produces one-dimensional results; the remaining

    products produce the separable scaling function.

    (x , y) = (x) (y)

    h (x , y) = (x) (y)

    v (x , y) = (x) (y)

    d (x , y) = (x) (y)

    These wavelets measure functional variations-intensity or gray-level

    variation for images-along different directions: h measures variations along columns

    (for example horizontal edges), v responds to variations along rows (like vertical edges)

    and d corresponds to variation along diagonals.

    The 2-D DWT can be implemented using digital filters and downsamplers. In

    two dimensional case, We get three sets of detail coefficients the horizontal, vertical,

    and diagonal details. The signal-scale filter can be Iterated (by typing the

    approximation output to the input of another filter bank) to produce a P scale transform in

    which scale j =J-1, J-2J-P. At first the image is inputted as W (J, m, n) input.

    Convolving its rows with h (-n) And h (-n) and downsampling its columns, we get

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    11/21

    two subimages whose horizontal resolutions are reduced by a factor of 2. The high pass

    or detail component characterizes the images high frequency information with vertical

    information. Both subimages are then filtered column-wise and down-sampled to yield

    four quarter-size output subimages - W d , W h , W v and W d. these

    subimages are inner products of f (x ,y) and the two-dimensional scaling and wavelet

    functions followed downsampling by two in each dimension.

    Decomposition level:

    Scales and

    filter bank

    iteration

    Approximation co-

    efficient

    image

    Truncated co-

    efficients

    (%)

    Reconstruction

    error

    (rms)

    1

    23

    4

    5

    256 x 256

    128 x 12864 x 64

    32 x 32

    16 x 16

    75

    9397

    98

    98

    1.93

    2.693.12

    3.25

    3.27

    Another factor affecting wavelet coding computational complexity and

    reconstruction error is the number of transform decomposition levels, since a p-scale fast

    wavelet transform involves P filter bank iterations, the number of operations in the

    computation of the forward and inverse transforms increases with the number of

    decomposition levels.

    Resulting decomposition level:

    compressed image

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    12/21

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    13/21

    The above figure shows the decomposition at level 1 with signal histogram .

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    14/21

    The above figure shows the decomposition at level 2 with signal histogram.

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    15/21

    The above figure shows the decomposition at level 3 with signal

    histogramEmbedded Zero Tree Wavelet Coder:

    It is a quantization and coding strategy that incorporates some characteristics

    of the wavelet decomposition. The particular characteristic used by the EZW coder is that

    there are wavelet co-efficients in different subbands that represent the same spatial

    location in the image. If the decomposition is such that the size of the different subbands

    is different, then a single co-efficient in the smaller subband may represent the same

    spatial location as multiple co-efficients in the other subbands.

    The EZW encoder is based on the two important observations:

    1. Natural images in general have a low pass spectrum. When an image is wavelet

    transformed the energy in the subbands decreases (low scale means high resolution), so

    the wavelet co-efficients will, on average, be smaller in the higher subbands than in the

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    16/21

    lower subbands. This shows that progressive encoding is a very natural choice for

    compressing wavelet transformed images, since the higher subbands only add detail.

    2. Large wavelet co-efficient are important than small wavelet co-efficients.

    These two observations are exploited by encoding the wavelet co-efficients in decreasingorder, in several passes. For every pass a threshold is chosen against which all the

    wavelet co-efficients are measured. If a wavelet co-efficient is larger than the threshold it

    is encoded and removed from the image, if it is smaller it is left for the next pass. When

    all the wavelet co-efficients have been visited the threshold is lowered and the image is

    scanned again to add more detail the already encoded image. This process is repeated

    until all the wavelet co-efficients have been encoded completely or another criterion has

    satisfied.

    Before we describe the EZW coder, we need to introduce some terminology.

    Given a threshold t, if a given co-efficient has a magnitude greater than T, it is called a

    significant co-efficient at level T.

    If the magnitude of the co-efficient is less than T (it is significant), and all its

    descendants have less than T, then the co-efficient is called a Zerotree root.

    Finally, it might happen that the co-efficient itself is less than T but some of its

    descendants have a value greater than T. such a co-efficient is called an isolated zero.

    The EZW encoder is a multiple-pass encoder, with each pass consisting of two

    pass significant map encoding or dominant pass, and refinement or subordinate pass.

    If Cmax is the value of the largest co-efficient, the initial value of the threshold

    To is given by

    To=2[log2 cmax]

    This selection guarantees that the largest co-efficient will lie in the interval [To ,

    2To]. In each pass, the threshold Ti is reduced to half the value it had in the previous

    pass:

    Ti=(Ti-1)/2

    For a given value of Ti, we assign one of four possible labels to the co-efficient:

    Significant positive (sp), Significant negative (sn),

    Zerotree root (zr), and isolated zero (iz).

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    17/21

    The relation between wavelet coefficients in different subbands as quad-trees.

    Image reconstruction:

    In order to obtain the reconstructed image, there must be some way to reverse the process

    or decompress the image back to its original state. This can be done using the inverse

    wavelet transform. The equation for inverse wavelet transform is given below:

    =

    s

    xdsd

    s

    t

    ss

    ctx

    22

    1),(

    1)(

    This inverse transform, however, is only valid if the admissibility condition holds true.

  • 8/22/2019 Fast Image Compression Using Dic Algorithm

    18/21