Image Coding/ Compression David Hemmert Pradeep Suthram Tammo Heeren All Mathcad files [MCD/PDF] can...
-
Upload
aleesha-oconnor -
Category
Documents
-
view
223 -
download
0
Transcript of Image Coding/ Compression David Hemmert Pradeep Suthram Tammo Heeren All Mathcad files [MCD/PDF] can...
Image Coding/ CompressionImage Coding/ Compression
David HemmertPradeep SuthramTammo Heeren
All Mathcad files [MCD/PDF] can be found on:http://webpages.acs.ttu.edu/theeren
OverviewOverview
ReviewDCT (Discrete Cosine Transform)JPEG compression/ decompressionWavelet compression/ decompression
ReviewReviewLinear QuantizationLinear Quantization
0 17 34 51 68 85 102 119 136 153 170 187 204 221 238 2550
17
34
51
68
85
102
119
136
153
170
187
204
221
238
255Quantization steps
Grayscale levels
quan
tized
gra
ysca
le le
vels
Quantization of gray levels in equidistance quantization steps
ReviewReviewadaptive Quantizationadaptive Quantization
0 17 34 51 68 85 102 119 136 153 170 187 204 221 238 2550
17
34
51
68
85
102
119
136
153
170
187
204
221
238
255Quantization steps
Grayscale levels
quan
tized
gra
ysca
le le
vels
0 17 34 51 68 85 102 119 136 153 170 187 204 221 238 2550
2000
4000
6000Image histogram
DCTDCT
Discrete Cosine transform Transformation of spatial image information into
its spatial frequency components
f
f0
DCT MathDCT Math
DCTfy fx G
fy fx0
X 1
x 0
Y 1
y
imagey x kx x fx( ) ky y fy( )
IDCTy x
0
X 1
fx 0
Y 1
fy
Gfy fx DCT
fy fx kx x fx( ) ky y fy( )
kx x fx( ) cos 2 x 1( )fx 2 X
ky y fy( ) cos 2 y 1( )fy 2 Y
DCTDCT
Essentially taking the 2D fourier transform and only keeping the real part of the coefficients
Works with any orthogonal kernel (e.g. in wavelet compression/ decompression)
DCT used in JPEG coding/ decoding
DCT ResultsDCT Results
1 10 100 1 1030
10
20
30
40
50
60SNR vs. Compression Ratio
Compression Ration
SN
R
0.005%/ 22000 / 8.8 dB 0.1%/ 864/ 10.3 dB 0.8%/ 128/ 13.5 dB 2%/ 49/ 15.2 dB
13%/ 7.7 / 20.4 dB
5%/ 20 / 17.5 dB
82%/ 1.2 / 34.4 dB
SNR and visual artifactSNR and visual artifact
Procedure/ TransformSNR of no
visual artifactsCompression
ratio
Linear quantization 35 dB 1.6
Adaptive quantization 31 dB 2
DCT 34 dB 2
JPEG
Wavelet 35 dB 9.3
JPEG compression of LennaJPEG compression of Lenna
• 512 X 512 pixels
•1 pixel = 8 bits
• 64 bytes = 8 x 8 submatrix = block
• 4096 submatrices
• 262144 total/elements total
8x8 pixel block
DCT QuantizerLevel-shift Encoder Data
• Discrete Cosine Transform of every element
• Gray scale image level-shifted by –128
• for n = 8, 2^(n-1) = 128
JPEG AlgorithmJPEG Algorithm
Quantization
using a typical normalization matrix
[ 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 ]
JPEG AlgorithmJPEG Algorithm
• Normalization using a standard table
JPEG AlgorithmJPEG Algorithm
Zig-zag pattern Removal of zeros Convert to binary Compare the number
of bits used
- Orthogonal Basis
- Area of basis equals zero
- Low pass / High pass filtering scheme to generate basis coefficients
- Compression by reducing the number of coefficient (zeroing least significant coefficients)
Discrete Wavelet Transform Discrete Wavelet Transform (DWT)(DWT)
Haar wavelet(averaging)
Mexican Hat wavelet(2nd derivative of Gaussian distribution)
Daub4 wavelet(most common used)
2
2
g Mex_Hat x( )
33 x
2 0 2
2
1
1
21.1
1.1
g Haar x( )
1.10 x
0 0.5 1
1
1
0.15
0.12
Wi
512200 i
200 300 400 500
0.2
0.1
0.1
Common Orthogonal Wavelet Common Orthogonal Wavelet BasesBases
A Row 1
C 0
C 3
0
0
0
0
C 2
C 1
C 1
C 2
0
0
0
0
C 3
C 0
C 2
C 1
C 0
C 3
0
0
0
0
C 3
C 0
C 1
C 2
0
0
0
0
0
0
C 2
C 1
C 0
C 3
0
0
0
0
C 3
C 0
C 1
C 2
0
0
0
0
0
0
C 2
C 1
C 0
C 3
0
0
0
0
C 3
C 0
C 1
C 2
a
b
c
d
e
f
g
h
Low 1
Hi 1
Low 2
Hi 2
Low 3
Hi 3
Low 4
Hi 4
Low 1
Low 2
Low 3
Low 4
Hi 1
Hi 2
Hi 3
Hi 4
Lowpass
Highpass
DWT(Daub4 Nth order matrix)
Row 1Pixels(l to r)
Row 1Coefficients
Row 1C 0
1 3
4 2C 1
3 3
4 2
C 23 3
4 2C 3
1 3
4 2
Low 1A
Low 1B
Low 2A
Low 2B
Hi 1A
Hi 1B
Hi 2A
Hi 2B
N-1times
Filtering SchemeFiltering Scheme
Coefficients for First Row Coefficients for First Row DWT TransformationDWT Transformation
- DWT each row- Regroup coefficients into Low/Hi subvectors
- DWT all columns of transformed matrix- Regroup coefficients into Low/Hi subvectors
WavA
Wav
Hi-Hi
Low-Low
Wav comp
90 % of thecoefficientszeroed
Generating CoefficientsGenerating Coefficients
original 50% coefficients 10% coefficients
2% coefficients 0.5% coefficients 0.1% coefficients
Application to “Lenna”Application to “Lenna”
2%
Signal to Noise RatioSignal to Noise Ratio
ReferencesReferences
1. Rafael C. Gonzalez, Richard E. Wood, “Digital Image Processing”, Addison Wesley, 1993
2. Geoffrey M. Davis, Aria Nosratinia, “Wavelet-based Image Coding: An Overview”, http://www.geoffdavis.net/
3. Subhasis, Saha, “Image Compression - from DCT to Wavelets : A Review”, http://www.acm.org/crossroads/xrds6-3/sahaimgcoding.html
4. Weidong Kou, “Digital Image Compression Algorithms and Standards,” Kluwer Academic Publishers, 1995.
5. “Selected Papers on Image Coding and Compression,” Majid Rabbani, Ed., Brian J. Thompson, Gen. Ed., SPIE Milestone Series, Vol MS-48, SPIE Optical Engineering Press, 1992.
6. “Fractal Image Compression Theory and Application,” Yuval Fisher, Ed., Springer-Verlag New York, 1995.
7. Bernd Jaehne, “Digital Image Processing”, Third Edition, Springer-Verlag, New York 1995