GNR602-Lec23 JPEG Image Compression
GNR602-Lec23 JPEG Image Compression
Slot 13
compression
Compression ratio:
Relevant Data Redundancy
Example:
Types of Data Redundancy
(1) Coding Redundancy
(2) Interpixel Redundancy
(3) Psychovisual Redundancy
N x M image
rk: k-th gray level
l(rk): # of bits for rk
P(rk): probability of rk
Example:
Coding Redundancy (cont’d)
auto-correlation
f ( x) o g ( x ) f ( x) g ( x a ) da
auto-correlation: f(x)=g(x)
Interpixel redundancy (cont’d)
• To reduce interpixel redundancy, some kind of transformation
must be applied on the data (e.g., thresholding, DFT, DWT)
Example:
threshold
original
11 ……………0000……………………..11…..000…..
thresholded
(1+10) bits/pair
Psychovisual redundancy
Example: quantization
256 gray levels 16 gray levels 16 gray levels + random noise
using
units/pixel
Entropy:
(e.g., bits/pixel)
Redundancy
• Redundancy:
(data vs info)
where:
image
Entropy Estimation (cont’d)
16
Differences in Entropy Estimates
(cont’d)
• What is the entropy of the pixel differences
image?
• How close is to ?
• Criteria
– Subjective: based on human observers
– Objective: mathematically defined criteria
IIT Bombay Slide 3
How are images compressed?
• Lossless compression: reversible, information preserving
• text compression algorithms,
• binary images, palette images
• Achievable compression
– Lossless: Modest 1:2 to 1:3 at best
– Lossy: Can be as high as 1:100
60%
40%
53.4 %
20%
6.7 %
4.3 %
0%
Rate measures
size of the compressed file C
Bitrate:
bits/pixel pixels in the image N
Distortion measures
N
1
Mean average error (MAE): MAE
N
y
i 1
i xi
N
1
Mean square error (MSE): MSE
i i
y x 2
N i 1
Model
X Y Q(Y) C
Transformation Quantization Encoding
Model
K << N
K-1 K-1
Transform Selection
Forward:
Inverse:
if u=0 if v=0
if u>0 if v>0
DCT (cont’d)
• Basis functions for a 4x4 image (i.e., cosines of
different frequencies).
DCT (cont’d)
Using DFT WHT DCT
8 x 8 sub-images
yields 64 coefficients
per sub-image.
Reconstructed images
by truncating
50% of the
coefficients
DCT is a more
compact
transformation!
Reconstructions
Where is compression?
• DCT is reversible transformation:
Y=TX X=T-1Y
• Where is compression?
Data decorrelation and energy compactness
Quantization (lossy operation)
Statistical encoding
8x8 block
High High
GNR602
Low Lecture 23 B. High
Krishna Mohan
IIT Bombay Slide 15
2-D Transform Coding
y00 + y23
y01 y10 y12
...
DC term High frequencies
GNR602 Lecture 23 B. Krishna Mohan
IIT Bombay Slide 16
Zig-zag ordering of DCT coefficients
Examples: 236/16 15
-22/11 -2
yq(k,l)=round[y(k,l)/Q(k,l)]
GNR602 Lecture 23 B. Krishna Mohan
IIT Bombay Slide 19
z (k,l)=yq(k,l)·Q(k,l)
Examples: 236/16 15
-22/11 -2
Original
GNR602 Lecture 23 B. Krishna Mohan
Original block
IIT Bombay Slide 22
Encoding of quantized DCT coefficients
Uncompressed CR = 3.5
GNR602 Lecture 23 B. Krishna Mohan
IIT Bombay Slide 34
Uncompressed CR =3.5
Uncompressed CR = 3.5
Uncompressed CR = 3.5
Uncompressed CR = 3.5
GNR602 Lecture 23 B. Krishna Mohan
IIT Bombay Slide 39
POWAI (8 BIT)
(Large Size)
Original CR = 6
NR602 Lecture 23 B. Krishna Mohan
IIT Bombay Slide 42
Sample Quantization Table CR=6
2 8 9 13 13 21 22 41
8 10 12 13 21 22 40 43
10 12 15 20 23 40 44 55
11 15 20 23 39 46 54 55
17 17 25 35 46 54 56 83
17 25 35 49 51 57 63 88
28 32 50 51 59 61 104 115
2 8 9 13 13 21 22 41
8 10 12 13 21 22 40 43
10 12 15 20 23 40 44 55
11 15 20 23 39 46 54 55
17 17 25 35 46 54 56 83
17 25 35 49 51 57 63 88
28 32 50 51 59 61 104 115
CR = 6 CR = 9.5
IIT Bombay Slide 43
Summary
• JPEG compressors and decompressors can be used for
compressing remotely sensed data as the Compression ratio
(CR) will seldom be high and hence JPEG gives satisfactory
performance in terms of maintaining image characteristics.
• As JPEG works with 8 by 8 block of pixels at a time the
implementation in hardware for JPEG is amenable to onboard
satellite platforms
• The JPEG process maintains a small Mean Squared Error
(MSE) at different compression ratios tested in the range
from 3.0 to 15.0.