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
Chapter 11 Image Data Compression Kasaei 4
Introduction (cntd) Kasaei 5
Introduction (cntd) Kasaei 6
Introduction (cntd) Different types of redundancy to be � removed/decreased in the compression algorithm include: Interpixel redundancy, 1. Psychovisual redundancy, 2. Coding redundancy, 3. Temporal redundancy, & 4. Spectral redundancy. 5. Kasaei 7
Introduction (cntd) Model Components of a coding system. Kasaei 8
Introduction (cntd) A general compression system model (the codec). Kasaei 9
Introduction (cntd) An encoder system (compressor). Kasaei 10
Introduction (cntd) A decoder system (decompressor). Kasaei 11
Introduction (cntd) General Image Coder Structure. Kasaei 12
Introduction (cntd) Kasaei 13
Introduction (cntd) Kasaei 14
Introduction (cntd) Kasaei 15
Introduction (cntd) Kasaei 16
Introduction (cntd) Kasaei 17
Introduction (cntd) Kasaei 18
Introduction (cntd) A compression system model (the codec). Kasaei 19
Introduction (cntd) A source encoder and decoder system. Kasaei 20
Introduction (cntd) Kasaei 21
Introduction (cntd) Kasaei 22
Introduction (cntd) Kasaei 23
Introduction (cntd) Kasaei 24
Introduction (cntd) Kasaei 25
Introduction (cntd) Kasaei 26
Introduction (cntd) Kasaei 27
Introduction (cntd) Kasaei 28
Introduction (cntd) Kasaei 29
Introduction (cntd) Kasaei 30
Introduction (cntd) Kasaei 31
Introduction (cntd) Kasaei 32
Introduction (cntd) Kasaei 33
Pixel Coding Kasaei 34
Pixel Coding (cntd) Kasaei 35
Pixel Coding (cntd) Kasaei 36
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 Kasaei 37
Pixel Coding (cntd) Kasaei 38
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). Kasaei 39
Pixel Coding (cntd) Kasaei 40
Pixel Coding (cntd) Kasaei 41
Pixel Coding (cntd) Kasaei 42
Pixel Coding (cntd) Kasaei 43
Pixel Coding (cntd) Kasaei 44
Pixel Coding (cntd) Kasaei 45
Pixel Coding (cntd) Kasaei 46
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. Kasaei 47
Pixel Coding (cntd) Kasaei 48
Pixel Coding (cntd) Kasaei 49
Encoding: 3/8 - 1/4 = 1/8 1/8 / 2 = 1/16 1/4 + 1/16 = 5/16 Binary Representation: /2 Decoding:
Huffman vs. Arithmetic Coding � 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. Kasaei 51
Pixel Coding (cntd) Kasaei 52
Pixel Coding (cntd) Kasaei 53
Pixel Coding (cntd) Kasaei 54
Predictive Techniques A lossy feed-forward prediction coding model. Kasaei 55
Predictive Techniques (cntd) A lossy feed-backward prediction coding model. Kasaei 56
Predictive Techniques (cntd) Kasaei 57
Predictive Techniques (cntd) Kasaei 58
Predictive Techniques (cntd) Kasaei 59
Predictive Techniques (cntd) Kasaei 60
Predictive Techniques (cntd) Kasaei 61
Predictive Techniques (cntd) Kasaei 62
Predictive Techniques (cntd) Kasaei 63
Transform Coding A transform coding system. Kasaei 64
Transform Coding (cntd) Kasaei 65
Transform Coding (cntd) Kasaei 66
Transform Coding (cntd) Kasaei 67
Transform Coding (cntd) Kasaei 68
Transform Coding (cntd) Kasaei 69
Transform Coding (cntd) A wavelet transform coding system. Kasaei 70
Transform Coding (cntd) Kasaei 71
Transform Coding (cntd) Kasaei 72
Transform Coding (cntd) Kasaei 73
Transform Coding (cntd) A basic DPCM/DCT encoder for motion compensated video coding. Kasaei 74
Kasaei 75
The JPEG Standard entropy table Q-table AC compressed Zigzag scan VLC image data image DCT Q differential VLC Offset DC (128) entropy table Kasaei 76
JPEG Example 139 144 149 153 155 155 155 155 1260 -1 -12 -5 2 -2 -3 1 • • 144 151 153 156 159 156 156 156 -23 -17 -6 -3 -3 0 0 -1 • • 150 155 160 163 158 156 156 156 -11 -9 -2 2 0 -1 -1 0 • • 159 161 162 160 160 159 159 159 -7 -2 0 1 1 0 0 0 • • 159 160 161 162 162 155 155 155 -1 -1 1 2 0 -1 1 1 • • 161 161 161 161 160 157 157 157 2 0 2 0 -1 1 1 -1 • • 162 162 161 163 162 157 157 157 -1 0 0 -1 0 2 1 -1 • • 162 162 161 161 163 158 158 158 -3 2 -4 -2 2 1 -1 0 • • 16 11 10 16 24 40 51 61 79 0 -1 0 0 0 0 0 12 12 14 19 26 58 60 55 -2 -1 0 0 0 0 0 0 14 13 16 24 40 57 69 56 -1 -1 0 0 0 0 0 0 14 17 22 29 51 87 80 62 -1 0 0 0 0 0 0 0 18 22 37 56 68 109 103 77 0 0 0 0 0 0 0 0 24 35 55 64 81 104 113 92 0 0 0 0 0 0 0 0 49 64 78 87 103 121 120 101 0 0 0 0 0 0 0 0 72 92 95 98 112 100 103 99 0 0 0 0 0 0 0 0 Kasaei 77
JPEG Example 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 0 -2 -1 -1 -1 0 0 -1 EOB Kasaei 78
JPEG (Com.) كﻮﻠﺑ ﻚﻳ 8×8 كﻮﻠﺑ ﻚﻳ 8×8 ﺮهراﺪﻘﻣ ار ﻞﺴﻜﻴﭘ زا 128 ﻢآ يدورو ﺮﻳﻮﺼﺗ ﻢﻴﻨآ ﻲﻣ يﺎﻬآﻮﻠﺑ زا يا ﻪﺘﺷر 8× 8 ﻲﻠﺴﻜﻴﭘ كﻮﻠﺑ 8×8 لﺎﻤﻋا ياﺮﺑ ﻩدﺎﻣﺁ DCT DCT ﻞﻳﺪﺒﺗرﺰﻳﺎﺘﻧاﻮآ Compressed data Kasaei 79
JPEG (Decom.) كﻮﻠﺑ 8×8 ياﺮﺑ ﻩدﺎﻣﺁ لﺎﻤﻋا رﺰﻳﺎﺘﻧاﻮآ يد IDCT ﻞﻳﺪﺒﺗ Compressed data IDCT ﺮهراﺪﻘﻣ ﻪﺑ ﻞﺴﻜﻴﭘ 128 ﻲﻣ ﻪﻓﺎﺿا ﻢﻴﻨآ ﻩﺪﺷ يزﺎﺳزﺎﺑ ﺮﻳﻮﺼﺗ ﻩﺪﺷ يزﺎﺳزﺎﺑ يﺎه كﻮﻠﺑ زا يا ﻪﺘﺷر Kasaei 80
JPEG VS JPEG 2000 JPEG at 0.125 bpp JPEG2000 at 0.125 bpp (192:1) (192:1) Kasaei 81
Lossy Techniques (WT-Based) Original Image Reconstructed; 56:1, PSNR: 23.98 Kasaei 82
The End
Recommend
More recommend