0% found this document useful (0 votes)
15 views37 pages

Dip-Unit 5

Uploaded by

Harry Muller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views37 pages

Dip-Unit 5

Uploaded by

Harry Muller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

DIP-Session 36

Unit 5:Image CompressionBasic


Concepts

Dr. Mrs Mamata Sachin Kalas


Email id:[email protected]
Image Compression?
• The problem of reducing the amount of data
required to represent a digital image.

• From a mathematical viewpoint: transforming


a 2-D pixel array into a statistically
uncorrelated data set.
Why do We Need Compression?
• For data STORAGE and data TRANSMISSION
• DVD
• Remote Sensing
• Video conference
• FAX
• Control of remotely piloted vehicle

• The bit rate of uncompressed digital cinema


data exceeds one Gbps.
Information vs Data

REDUNDANT
DATA

INFORMATION

DATA = INFORMATION + REDUNDANT DATA


Why Can We Compress?
• Spatial redundancy
• Neighboring pixels are not independent but
correlated

. Temporal redundancy
Fundamentals
• Basic data redundancies:
1. Coding redundancy
2. Inter-pixel redundancy
3. Psycho-visual redundancy
Coding Redundancy
Let us assume, that a discrete random variable rk in the interval [0,1]
represent the gray level of an image:
nk
pr (rk ) = k = 0,1, 2,, L −1
n
If the number of bits used to represent each value of r kis l(r ),k then
the average number of L−1
bits required to represent each pixel:
Lavg = ∑ l(rk ) p r (rk )
k =0
The total number bits required to code an MxN image:
M .N.Lavg
Coding Redundancy

7
Lavg = ∑ l 2 (rk ) p r (rk ) n1
k =0 Compression CR =
n
= 2(0.19) + 2(0.25) + 2(0.21) + 3(0.16) + 4(0.08) ratio: 2
+ 5(0.06) + 6(0.03) + 6(0.02) Relative data 1
Rd =1−
= 2.7bits redundancy: CR
3 1
CR = = 1.11 Rd =1− = 0.099
2.7 1.11
Inter-pixel Redundancy

Here the two pictures have

Approximately the same

Histogram.

We must exploit Pixel

Dependencies.

Spatial Redundancy
Each pixel can be estimated
Geometric Redundancy
From its neighbors
Inter-frame Redundancy
Psycho-visual Redundancy
Elimination of psych-visual redundant data results in a loss of
quantitative information ,it is commonly referred as quantization.

Improved Gray-
Scale
Fidelity Criteria

The general classes of criteria :


1. Objective fidelity criteria
2. Subjective fidelity criteria
Fidelity Criteria
Objective fidelity:
Level of information loss can be expressed as a function
of the original and the compressed and subsequently
decompressed image.
1/2
1 M −1N−1 ˆ
Root-mean-square erms = ∑∑
MN x=0 y=0
[ f (x, y) − f (x, y)]2

error
M −1N−1

∑∑ fˆ (x, y) 2
x=0 y=0
Mean-square SNRms = M −1N−1
signal-to-noise ratio
∑∑ [ fˆ (x, y) − f (x, y)] 2

x=0 y=0
Fidelity Criteria

erms = 6.93 erms = 6.78


SNRrm = 10.25 SNRrm = 10.39
Fidelity Criteria
Subjective fidelity (Viewed by Human):
• By absolute rating
• By means of side-by-side comparison of f (x, y)and fˆ (x, y)
Image Compression Model

Remove Input Increase the


Redundancies Noise Immunity

The source encoder is responsible for removing redundancy

(coding, inter-pixel, psycho-visual)

The channel encoder ensures robustness against channel noise.


Classification
. Lossless compression
. lossless compression for legal and medical documents,
computer programs
. exploit only code and inter-pixel redundancy
. Lossy compression
. digital image and video where some errors or loss can be
tolerated
. exploit both code and inter-pixel redundancy and sycho-
visual perception properties
Error-Free Compression

Applications:
• Archive of medical or business documents
• Satellite imaging
• Digital radiography

They provide: Compression ratio of 2 to 10.


Error-Free Compression
Variable-length Coding

Huffman
coding

The most popular technique for removing coding redundancy is due

to Huffman (1952)

Huffman Coding yields the smallest number of code symbols per

source symbol

The resulting code is optimal


Error-Free Compression
Variable-length Coding

Huffman
coding (optimal
code)
Error-Free Compression
Variable-length Coding

Huffman
coding

Lavg = (0.4)(1) + (0.3)(2) + (0.1)(3) + (0.1)(4) + (0.06)(5) + (0.04)(5)


= 2.2bits / symbol
entropy = 2.14bits / symbol
LZW Coding
Error Free Compression Technique.

Remove Inter-pixel redundancy.

Requires no priori knowledge of probability distribution of pixels.

Assigns fixed length code words to variable length sequences.

Patented Algorithm US 4,558,302.


LZW Coding
Coding Technique

A codebook or a dictionary has to be constructed

For an 8-bit monochrome image, the first 256 entries are

assigned to the gray levels 0,1,2,..,255.

As the encoder examines image pixels, gray level sequences

that are not in the dictionary are assigned to a new entry.


LZW Coding
Example
Consider the following 4 x 4 8 bit image Di c t ionary Loc at i on E nt ry

39 39 126 126 0 0
39 39 126 126 1 1

39 39 126 126 . .

39 39 126 126 255 255

256 -

511 -

Initial Dictionary
LZW Coding
•Is 39 in the dictionary……..Yes
39 39 126 126
39 39 126 126
39 39 126 126
•What about 39-39………….No
39 39 126 126

•Then add 39-39 in entry 256


Dictionary L o c a t i o n E n t ry

0 0
•And output the last recognized symbol…39
1 1

. .

255 255
3 9 -3 9
256 -

511 -
Error-Free Compression
Bit-plane coding abcdef
a
Bit-plane coding is based on b
decomposing a multilevel c

image into a series of binary d


e
images and compressing
f
each binary image .
Error-Free Compression Binary Bit-planes Gray Bit-planes

Bit-plane coding

Bit-plane
decomposition

m −bit gray scale: am−1 2m−1 + am−2 2m−2 ++ a0 2


0

Gray code: g gm−1g g


m−21 0

gl = a ⊕
l a l +1 0≤l≤m−2
g m−1 = am−1
Error-Free Compression Binary Bit-planes Gray Bit-planes

Bit-plane coding

Bit-plane
decomposition
Error-Free Compression
Bit-plane coding

• Constant area Coding


H +H
• One-dimensional run-length coding H RL =
0 1
L0 + L1

Average values of
black and white run
lengths
• Two-dimensional RLC

Relative Address Coding (RAC) is based on tracking the


binary transitions.
Image Compression Standards
Why Do We Need International Standards?
. International standardization is conducted to achieve
inter-operability .
. Only syntax and decoder are specified.
. Encoder is not standardized and its optimization is left to the
manufacturer.
. Standards provide state-of-the-art technology that is
developed by a group of experts in the field.
. Not only solve current problems, but also anticipate the future
application requirements.
. Most of the standards are sanction by the International
Standardization Organization (ISO) and the
Consultative Committee of the International
Telephone and Telegraph (CCITT)
Image Compression Standards
Binary Image Compression Standards

CCITT Group 3 and 4

. They are designed as FAX coding methods.


. The Group 3 applies a non-adaptive 1-D run length
coding and optionally 2-D manner.
. Both standards use the same non-adaptive 2-D coding
approach, similar to RAC technique.
. They sometime result in data expansion. Therefore, the
Joint Bilevel Imaging Group (JBIG), has adopted several
other binary compression standards, JBIG1 and JBIG2.
Image Compression Standards
Continues Tone Still Image Comp.

What Is JPEG?
. "Joint Photographic Expert Group". Voted as

international standard in 1992.


. Works with color and grayscale images, e.g., satellite,
medical, ...
. Lossy and lossless
Image Compression Standards
Continues Tone Still Image Comp. - JPEG

. First generation JPEG uses DCT+Run length Huffman


entropy coding.

. Second generation JPEG (JPEG2000) uses wavelet


transform + bit plane coding + Arithmetic entropy
coding.
Image Compression Standards
Continues Tone Still Image Comp. - JPEG
. Still-image compression standard
. Has 3 lossless modes and 1 lossy mode
.
sequential baseline encoding
. encode in one scan
. input & output data precision is limited to 8 bits, while quantized
DCT values are restricted to 11 bits
. progressive encoding
. hierarchical encoding
. lossless encoding
. Can achieve compression ratios of up-to 20 to 1 without
noticeable reduction in image quality
Image Compression Standards
Continues Tone Still Image Comp. - JPEG
. Work well for continuous tone images, but not good for
cartoons or computer generated images.
. Tend to filter out high frequency data.
. Can specify a quality level (Q)
. with too low Q, resulting images may contain blocky, contouring
and ringing structures.
. 5 steps of sequential baseline encoding
. transform image to luminance/chrominance space (YCbCr)
. reduce the color components (optional)
. partition image into 8x8 pixel blocks and perform DCT on each
block
. quantize resulting DCT coefficients
. variable length code the quantized coefficients
Image Compression Standards
JPEG Encoding

Original JPEG 27:1


Image Compression Standards
Video Compression Standards
Video compression standards:
1. Video teleconferencing standards
. H.261 (Px64)
. H.262
. H.263 (10 to 30 kbit/s)
. H.320 (ISDN bandwidth)
2. Multimedia standards
. MPEG-1 (1.5 Mbit/s)
. MPEG-2 (2-10 Mbit/s)
. MPEG-4 (5 to 64 kbit/s for mobile and PSTN and uo to 4
Mbit/s for TV and film application)
THANK
YOU

You might also like