Chapter 5 : IMAGE COMPRESSION – LOSSLESS COMPRESSION - 1)Asmawati @ Nur Hidayah Bte Jusoh (IT...

21
Chapter 5 : IMAGE COMPRESSION – LOSSLESS COMPRESSION - 1) Asmawati @ Nur Hidayah Bte Jusoh (IT 01481) 2) Azmah Bte Abdullah Sani (IT 01494) 3) Dina Meliwana Bte Asjhad Zaenie (IT 02373) 4) Ummi Susanti Bte Rafiei (IT 02145)

Transcript of Chapter 5 : IMAGE COMPRESSION – LOSSLESS COMPRESSION - 1)Asmawati @ Nur Hidayah Bte Jusoh (IT...

Chapter 5 : IMAGE COMPRESSION – LOSSLESS

COMPRESSION -

1) Asmawati @ Nur Hidayah Bte Jusoh (IT 01481)

2) Azmah Bte Abdullah Sani (IT 01494)

3) Dina Meliwana Bte Asjhad Zaenie (IT 02373)

4) Ummi Susanti Bte Rafiei (IT 02145)

Contents:

5.1. Overview of Image Compression

5.2. Lossless Compression Methods

5.3. Application Of Lossless Compression

5.4. Recent Research Of Lossless Compression.

Overview Of Image Compression

- Process of reducing or compressing size and image data

files but still retaining important information.

- compressed file is used to reconstruct image.

- relationship between compressed and uncompressed file is

denoted as the compression ratio :

Introduction

Compression Ratio =Uncompressed file size

Compressed file size=

SIZEU

SIZEC

Fidelity Criteria

Fidelity Criteria

Criterion used to determine important information to be

retained when compressing files.

Divided into 2 classes :

i. Objective fidelity criteria ii.Subjective fidelity criteria

What are the objective fidelity criteria & subjective fidelity

criteria??

Fidelity Criteria

Errors are measured using :

1. ROOT- MEAN-SQUARE ERROR

2. ROOT-MEAN-SQUARE SIGNAL-TO-NOISE RATIO(SNR)

3. PEAK SIGNAL-TO-NOISE RATIO

Objective fidelity criteria measures amount of error in

decompressed image. The smaller the value of error metrics,

the better the compressed image.

Subjective testing is performed by creating a database of

image to be tested.

Fidelity Criteria

Images will be tested by having all test subjective to evaluate

them according to a predefined scoring criterion.

The results are then analyzed statistically using average &

standard deviations as metrics.

3 category of tests:

1. IMPAIRMENT TEST

assess images in terms of how bad they are

2. QUALITY TEST

assess images in terms of how good they are

3. COMPARISON TEST

evaluate images on a side-by side basis

Compression System Model

1) Compressor Preprocessing

- Data reduction : Reduce image by using gray level and/or spatial quantization or any image enhancement process

- Mapping : Map image data into other mathematical space ( easier to compress data )

Encoding

- Quantization : Takes potentially continuous from mapping stage and put in discrete form

- Coding : Maps discrete data onto a code

Compression System Model

2) Decompressor Decoding

- Reverse coding of compressed file by mapping to original

Inverse Mapping

- Reverse mapping process Postprocessing

- Enhance the look of final image

Lossless Compression Method

Lossless Compression Methods:

1) Huffman Coding

2) Run – Length Coding

3) Lempel – Ziv – Welch Coding

4) Arithmetic Coding

Introduction :

Lossless compression methods guarantees that the decompressed image is absolutely identical to the image before compression.

Lossless Compression Methods<< HUFFMAN CODING >>

HUFFMAN CODING

- developed by D. A. Huffman

- based on the fact that in an input stream certain tokens

occur more often than others.

- generating codes that closest to entrophy.

Lossless Compresion Methods<<Step By Step >>

Step By Step…

Find the gray – level probabilities for the image by

finding the histogram. Order the input probabilities (histogram magnitudes )

from smallest to largest. Combine the smallest two. (add the two smallest) GOTO step 2, until only two probabilities are left. By working backward along the tree, generate code by

alternating assignment of 0 and 1.

Lossless Compression Methods<< RUN – LENGTH CODING >>

RUN – LENGTH CODING

- used when there is a tendency for long runs of repeated

digitized gray levels to occur.

- the Run-length coding (RLC) works by counting the number

of adjacent pixels with the same gray-level value.

Lossless Compression Methods<< Step By Step >>

Step By Step…

Define the required parameters horizontally or vertically. Define a convention for the first RLC number in a row

(represent a run of 0’s or 1’s). Extend basic RLC using Bit-plane RLC – works by

applying basic RLC to each bit plane independently. The compression results is then improved using preprocessing

to reduce the number of gray level. Then , the reduce image data mapped to a Gray Code,

Lossless Compression Methods<< Example >>

0 0 0 0 0 0 0 0

0 0 0 0 1 0 0 0

1 1 0 0 1 1 0 0

0 1 1 1 1 1 1 0

1 1 1 1 1 1 1 1

0 1 0 1 0 1 0 1

0 0 0 0 1 1 1 0

0 1 0 1 1 0 0 0

Horizontal Run Length Coding Using the convention of 0’s as the first value.

No of rowsROW 1

ROW 2

ROW 4

ROW 5

ROW 3

ROW 6

ROW 8ROW 7

8

4, 1, 3

1, 2, 2, 2, 21, 6, 1

1, 81, 1, 1, 1, 1, 1, 1, 1

4, 3, 11, 1, 1, 2, 3

Lossless Compresion Methods<<Lempel-Ziv-Welch Coding>>

LEMPEL-ZIV-WELCH CODING (LZW)

- works by coding strings of data

- for images, the strings correspond to sequence of pixel value

- a string table that contains the strings and their corresponding value is created

- the table is updated as the file is read, with new codes being inserted whenever a new string is encountered

Lossless Compresion Methods<<Lempel-Ziv-Welch Coding>>

- if the table already contains the string, the corresponding code for that string is put into the compressed file

- uses code words with more bits than the original data

- the table consists of the original 2n entries (corresponding to the original n-bit data) and allows another 2n-k - 2n entries for string codes

Lossless Compression Method<<Arithmetic Coding>>

ARITHMETIC CODING

- transforms input data into a single floating point between

0 and 1

- the image must be divided into small subimages to be encoded

- works by successively subdividing the interval between 0 and 1

- impractical to use alone

Lossless Compresion Methods<<Arithmetic Coding>>

Step By Step…

Find the probability for each pixel

Divide the initial subinterval based on the distribution

The first pixel value is coded by extracting the subinterval corresponding to it, and subdivide again based on the same relative distribution

Repeat step (3) for each pixel value until a final interval is determined

Any value within this subinterval can be used to represent the sequence of gray-level values

Application Of Lossless Compression

QuickTime ‘Animation’ Codec

- suited for storage of two-dimensional animation and computer-

generated video content.

PICTools Medical Compression Toolkit’s High Speed

Lossless JPEG by Pegasus.

- uses in the field of cardiology and ultrasound

imaging.

Application Of Lossless Compression

Voice E-mail 4.0 (Voice E-mail’s Lossless Audio

Compression)

- uses the latest in digital audio compression technology to

compress messages before transferring them through

CompuServe, America Online, Microsoft Network, and the

Internet.

Recent Study @ Research Of Lossless Compression…

PPG Lossless Image Compression Project by UCLA

Develop/implement a lossless compression/decompression scheme for use

with the UCLA PACS Image Archive satisfying the following

Key Technical Requirements:

1. Relatively high speeds of compression/decompression. 2. Flexible enough to work with image data from all modalities. 3. Robust/high-reliability code and support environment (e.g. compilers). 4. Longevity, i.e. be able to restore original images after 20 years.