Lecture 20
Lecture 20
Merge
Symbol Inverse
Decoder Transform
n×n
Compressed subimages Decompressed
Image Image
is defined as:
∑ f (m)∏ (−1)
N −1 q −1
1
W (u ) = , u = 0,1, , N − 1.
bi ( m ) bq−1−i ( u )
N m =0 i =0
u =0 i=0
g ( m) = ∑ ∑ f (n)∏ (−1)
N −1 N −1 q −1 q −1
1
∏ (−1)
bi ( n ) bq −1−i ( u )
bi ( m ) bq −1−i ( u )
N
u =0
n =0 i =0
i =0
This is W ( u ) with m replaced with n.
∑ f (n)∑∏ (−1)
N −1 N −1 q −1
1 (bi ( n ) + bi ( m ) )bq −1−i ( u )
=
N n =0 u =0 i = 0
?
= f (m) (HW problem!!)
Walsh Transform (2-D case)
N −1 N −1
(2m + 1)uπ ( 2n + 1) vπ
C (u, v ) = α (u )α (v) f (m, n) cos cos ,
m= 0 n = 0 2N
2 N
u , v = 0,1, , N − 1, where
1 , u=0
α(u ) =
N
2
N , u = 1,2, , N −1
u = 0 v =0 2N
2 N
m, n = 0,1, , N − 1.
• The DCT is
Separable (can perform 2-D transform in terms of 1-D
transform).
Symmetric (the operations on the variables m, n are identical)
Forward and inverse transforms are identical
Fraction of DCT coeff. Used 0.65, Fraction of DCT coeff. Used 0.41,
MSE: 1.6 MSE: 4
Discrete Cosine Transform Example
Fraction of DCT coeff. Used 0.19, Fraction of DCT coeff. Used 0.08,
MSE: 7.7 MSE: 12
Transform Selection
• Commonly used ones are Karhunen-Loeve (Hotelling) transform
(KLT), discrete cosine transform (DCT), discrete Fourier
transform (DFT), Walsh-Hadamard transform (WHT).
• This step by itself is lossless and does not lead to compression. The
quantization of the resulting coefficients results in compression.
• DCT is by far the most popular choice and is used in the JPEG
(Joint Photographic Experts Group) image standard.
Reconstructed Image Error Image
DCT
RMSE = 0.018
DFT
RMSE = 0.028
WHT
RMSE = 0.023
0.028
r
or 0.026
r
E
S
M 0.024
R
d
e
zil
a 0.022
mr
o
N
0.02
0.018
0.016
1
10
Size of subimage
Bit Allocation
• After transforming each subimage, only a fraction of the
coefficients are retained. This can be done in two ways:
RMSE = 0.029
Threshold coding
RMSE = 0.038
Zonal coding
1 1 1 0 1 0 0 0 0 1 5 6 14 15 27 28
1 1 1 0 0 0 0 0 2 4 7 13 16 26 29 42
1 1 0 0 0 0 0 0 3 8 12 17 25 30 41 43
1 0 0 0 0 0 0 0 9 11 18 24 31 40 44 53
1 0 0 0 0 0 0 0 10 19 23 32 39 45 52 54
0 0 1 0 0 0 0 0 20 22 33 38 46 51 55 60
0 0 0 0 0 0 0 0 21 34 37 47 50 56 59 61
0 0 0 0 0 0 0 0 35 36 48 49 57 58 62 63
Original
Transform
coefficient
T (u, v)
Thresholded Tˆ (u, v ) = round
Normalization
Factor
Z(u, v) is a transform normalization matrix. Typical example
is shown below.
16 11 10 16 24 40 51 61
12 12 14 19 26 58 60 55
14 13 16 24 40 57 69 56
14 17 22 29 51 87 80 62
18 22 37 56 68 109 103 77
24 35 55 64 81 104 113 92
49 64 78 87 103 121 120 101
72 92 95 98 112 100 103 99
RMSE = 0.023
Quantization matrix Z
(9152 non-zero coefficients)
RMSE = 0.048
Quantization matrix 8Z
(2389 nonzero coefficients)