DIP S8ECE MODULE5 Part1
DIP S8ECE MODULE5 Part1
High definition
1920x1080x24 bits
How many CDs?
1920
Need for compact image
representation
7s
Goal of Image Compression
– The goal of image compression is to reduce the
amount of data required to represent a digital
image
REDUNDANTDATA
INFORMATION
compression
Compression ratio:
Data Redundancy (cont’d)
• Lossless
– Information preserving
– Low compression ratios
• Lossy
– Not information preserving
– High compression ratios
(1) Coding
(2) spatial and temporal( Interpixel)
(3) irrelevant (Psychovisual )
N x M image
rk: k-th gray level Expected value:
P(rk): probability of r k E ( X ) xP ( X x)
l(rk): no. of bits for rk x
Coding Redundancy (con’d)
Example:
Coding Redundancy (cont’d)
Spatial redundancy ,
geometric redundancy and
interframe redundancy
• Interpixel redundancy
implies
All 256that any
intensities are pixel value
equally probable
can be reasonably
predicted by its neighbors
(i.e., correlated).
Spatial and temporal redundancy
f ( x) o g ( x) f ( x) g ( x a )da
autocorrelation: f(x)=g(x)
Psychovisual redundancy
• How close is to ?
• Criteria
– Subjective: based on human observers
– Objective: mathematically defined criteria
Subjective Fidelity Criteria
Objective Fidelity Criteria
The error between two functions is given by:
e( x, y ) f ( x, y ) f ( x, y )
So, the total error between the two images is
M 1 N 1
[ f ( x , y ) f ( x , y )]
x0 y 0
Compression
Software Research
Lossless Compression
Image Compression
Model
Image Compression
Model (cont’d)
Software Research
Error-Free Compression
• Some applications require no error in
compression (medical, business documents,
etc..)
• CR=2 to 10 can be expected.
• Make use of coding redundancy and inter-
pixel redundancy.
• Ex: Huffman codes, LZW, Arithmetic
coding, 1D and 2D run-length encoding,
Loss-less Predictive Coding, and Bit-Plane
Coding. Software Research
Error-Free Compression
• Variable-Length Coding
• LZW Coding
• Bit-Plane Coding
• Lossless Predictive Coding
Lossy Compression
• Lossy Predictive Coding
• Transform Coding
• Wavelet Coding
Huffman Coding
• The most popular technique for removing coding
redundancy is due to Huffman (1952)
Software Research
Huffman Codes
• Forward Pass
1. Sort probabilities per symbol
2. Combine the lowest two probabilities
3. Repeat Step2 until only two probabilities remain.
Huffman Codes
Backward Pass
Assign code symbols going backwards
Software Research
Decode
Huffman Decoding
• After the code has been created,
coding/decoding can be implemented using a
look-up table.
• Note that decoding is done unambiguously.