In the name of Allah the compassionate, the merciful Digital Image - - PowerPoint PPT Presentation
In the name of Allah the compassionate, the merciful Digital Image - - PowerPoint PPT Presentation
In the name of Allah the compassionate, the merciful Digital Image Processing S. Kasaei Kasaei S. Room CE307, SUT E-Mail: skasaei@sharif.ed Home Page: http://ce.sharif.edu http://ipl.ce.sharif.edu http://sharif.edu/~skasaei Kasaei 3
In the name of Allah
the compassionate, the merciful
3 Kasaei
S.
- S. Kasaei
Kasaei
Room CE307, SUT E-Mail: skasaei@sharif.ed Home Page: http://ce.sharif.edu http://ipl.ce.sharif.edu http://sharif.edu/~skasaei
Digital Image Processing
4 Kasaei
Chapter 11
Image Data Compression
5 Kasaei
Introduction (cntd)
6 Kasaei
Introduction (cntd)
7 Kasaei
Introduction (cntd)
- Different types of redundancy to be
removed/decreased in the compression algorithm include:
1.
Interpixel redundancy,
2.
Psychovisual redundancy,
3.
Coding redundancy,
4.
Temporal redundancy, &
5.
Spectral redundancy.
8 Kasaei
Introduction (cntd)
Model
Components of a coding system.
9 Kasaei
Introduction (cntd)
A general compression system model (the codec).
10 Kasaei
Introduction (cntd)
An encoder system (compressor).
11 Kasaei
Introduction (cntd)
A decoder system (decompressor).
12 Kasaei
Introduction (cntd)
General Image Coder Structure.
13 Kasaei
Introduction (cntd)
14 Kasaei
Introduction (cntd)
15 Kasaei
Introduction (cntd)
16 Kasaei
Introduction (cntd)
17 Kasaei
Introduction (cntd)
18 Kasaei
Introduction (cntd)
19 Kasaei
Introduction (cntd)
A compression system model (the codec).
20 Kasaei
Introduction (cntd)
A source encoder and decoder system.
21 Kasaei
Introduction (cntd)
22 Kasaei
Introduction (cntd)
23 Kasaei
Introduction (cntd)
24 Kasaei
Introduction (cntd)
25 Kasaei
Introduction (cntd)
26 Kasaei
Introduction (cntd)
27 Kasaei
Introduction (cntd)
28 Kasaei
Introduction (cntd)
29 Kasaei
Introduction (cntd)
30 Kasaei
Introduction (cntd)
31 Kasaei
Introduction (cntd)
32 Kasaei
Introduction (cntd)
33 Kasaei
Introduction (cntd)
34 Kasaei
Pixel Coding
35 Kasaei
Pixel Coding (cntd)
36 Kasaei
Pixel Coding (cntd)
37 Kasaei
Pixel Coding (cntd)
Types of entropy coding schemes:
FLC to VLC:
Huffman Coding, [1952]; used in JPEG98, WSQ. Golomb-Rice coding.
VLC to FLC:
Run-Length Coding (RLC) for b/w, [1977]; used in JPEG98, WSQ. Bitplane-RLC for gray. Lempel-Ziv-Welch (LZW), [1977], requires no a priori knowledge of the
probability of occurrence of symbols; used in GIF, TIFF, UNIX gzip.
VLC to VLC:
Arithmetic Coding, [1975]. Adaptive arithmetic coding; used in JPEG2000, MPEG-4, H264.
Fixed-Length Coding: FLC Variable-Length Coding: VLV
38 Kasaei
Pixel Coding (cntd)
39 Kasaei
Huffman Coding
Idea: more frequent symbols shorter
codewords.
Algorithm:
- Huffman coding generates prefix code. ☺
- Can be applied to one symbol at a time (scalar coding), or a group of symbols
(vector coding), or one symbol conditioned on previous symbols (conditional coding).
40 Kasaei
Pixel Coding (cntd)
41 Kasaei
Pixel Coding (cntd)
42 Kasaei
Pixel Coding (cntd)
43 Kasaei
Pixel Coding (cntd)
44 Kasaei
Pixel Coding (cntd)
45 Kasaei
Pixel Coding (cntd)
46 Kasaei
Pixel Coding (cntd)
47 Kasaei
Arithmetic Coding
Basic idea:
Represent a sequence of symbols by an interval with length
equal to its probability.
The interval is specified by its lower boundary (l), upper
boundary (u), & length d (=probability).
The codeword for the sequence is the common bits in binary
representations of l & u.
The interval is calculated sequentially starting from the
first symbol:
The initial interval is determined by the first symbol. The next interval is a subinterval of the previous one, determined
by the next symbol.
48 Kasaei
Pixel Coding (cntd)
49 Kasaei
Pixel Coding (cntd)
Encoding: Decoding:
/2
3/8 - 1/4 = 1/8 1/8 / 2 = 1/16 1/4 + 1/16 = 5/16 Binary Representation:
51 Kasaei
Huffman coding:
Converts a fixed number of symbols into a variable length
codeword.
Efficiency:
To approach entropy rate, must code a large number of symbols
together.
Used in all image and video coding standards.
Arithmetic coding:
Converts a variable number of symbols into a variable length
codeword.
Efficiency:
Can approach the entropy rate by processing one symbol at a time. Easy to adapt to changes in source statistics. Integer implementation is available. Used as advanced options in image and video coding standards.
Huffman vs. Arithmetic Coding
52 Kasaei
Pixel Coding (cntd)
53 Kasaei
Pixel Coding (cntd)
54 Kasaei
Pixel Coding (cntd)
55 Kasaei
Predictive Techniques
A lossy feed-forward prediction coding model.
56 Kasaei
Predictive Techniques (cntd)
A lossy feed-backward prediction coding model.
57 Kasaei
Predictive Techniques (cntd)
58 Kasaei
Predictive Techniques (cntd)
59 Kasaei
Predictive Techniques (cntd)
60 Kasaei
Predictive Techniques (cntd)
61 Kasaei
Predictive Techniques (cntd)
62 Kasaei
Predictive Techniques (cntd)
63 Kasaei
Predictive Techniques (cntd)
64 Kasaei
Transform Coding
A transform coding system.
65 Kasaei
Transform Coding (cntd)
66 Kasaei
Transform Coding (cntd)
67 Kasaei
Transform Coding (cntd)
68 Kasaei
Transform Coding (cntd)
69 Kasaei
Transform Coding (cntd)
70 Kasaei
Transform Coding (cntd)
A wavelet transform coding system.
71 Kasaei
Transform Coding (cntd)
72 Kasaei
Transform Coding (cntd)
73 Kasaei
Transform Coding (cntd)
74 Kasaei
Transform Coding (cntd)
A basic DPCM/DCT encoder for motion compensated video coding.
75 Kasaei
76 Kasaei
The JPEG Standard
DCT Q Q-table Zigzag scan differential VLC VLC entropy table entropy table Offset (128) image compressed image data AC DC
77 Kasaei
JPEG Example
- 139 144 149 153 155 155 155 155
- 144 151 153 156 159 156 156 156
- 150 155 160 163 158 156 156 156
- 159 161 162 160 160 159 159 159
- 159 160 161 162 162 155 155 155
- 161 161 161 161 160 157 157 157
- 162 162 161 163 162 157 157 157
- 162 162 161 161 163 158 158 158
- 1260 -1 -12
- 5 2 -2 -3 1
- 23 -17 -6
- 3 -3 0 0 -1
- 11 -9 -2
2 0 -1 -1 0
- 7 -2 0 1 1 0 0 0
- 1 -1 1 2 0 -1 1 1
- 2 0 2 0 -1 1 1 -1
- 1 0 0 -1 0 2 1 -1
- 3 2 -4 -2 2 1 -1 0
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 79 0 -1 0 0 0 0 0
- 2 -1 0 0 0 0 0 0
- 1 -1 0 0 0 0 0 0
- 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
78 Kasaei
JPEG Example
79
- 2
- 1
- 1
- 1
- 1
EOB
79 0 -1 0 0 0 0 0
- 2 -1 0 0 0 0 0 0
- 1 -1 0 0 0 0 0 0
- 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
79 Kasaei
JPEG (Com.)
كﻮﻠﺑ ﻚﻳ8×8 كﻮﻠﺑ ﻚﻳ8×8
كﻮﻠﺑ8×8 لﺎﻤﻋا ياﺮﺑ ﻩدﺎﻣﺁ DCT
ﺮهراﺪﻘﻣ ار ﻞﺴﻜﻴﭘ زا128 ﻢآ ﻢﻴﻨآ ﻲﻣ
Compressed data DCT ﻞﻳﺪﺒﺗرﺰﻳﺎﺘﻧاﻮآ
يﺎﻬآﻮﻠﺑ زا يا ﻪﺘﺷر8× 8ﻲﻠﺴﻜﻴﭘ
يدورو ﺮﻳﻮﺼﺗ
80 Kasaei
JPEG (Decom.)
رﺰﻳﺎﺘﻧاﻮآ يد
IDCT ﻞﻳﺪﺒﺗ كﻮﻠﺑ8×8 ياﺮﺑ ﻩدﺎﻣﺁ لﺎﻤﻋا IDCT
ﺮهراﺪﻘﻣ ﻪﺑ ﻞﺴﻜﻴﭘ128 ﻲﻣ ﻪﻓﺎﺿا ﻢﻴﻨآ Compressed data ﻩﺪﺷ يزﺎﺳزﺎﺑ يﺎه كﻮﻠﺑ زا يا ﻪﺘﺷر ﻩﺪﺷ يزﺎﺳزﺎﺑ ﺮﻳﻮﺼﺗ
81 Kasaei
JPEG at 0.125 bpp (192:1) JPEG2000 at 0.125 bpp (192:1)
JPEG VS JPEG 2000
82 Kasaei
Lossy Techniques (WT-Based)
Original Image Reconstructed; 56:1, PSNR: 23.98