Biomedical signal and image processing (Course 055-355-5501) Lect. 5. Principles of signal and image coding. Classification of coding methods. Generalized quantization, Epsilon-entropy Lossless and Lossy coding. Coding-decoding quality estimation: collective user vs expert user in biomedical applications 3 step coding: discretization-element-wise-quantization-statistical coding. Discretization; variety of bases. Global and block-wise transforms. Shift bases: decorrelation by prediction, k = a k a k ; a k g a = N n= 1 n k n 2 ; { g n } arg min[ MathExp( k )] = ; 2 For N=1: g MathExp( a a ) MathExp( a ) 1 = k k 1 / k 1 Predictive coding methods: Delta-modulation, DPCM,multi-resolution, sub-band decomposition and wavelet coding. Transform methods: global, block-wise. Variety of Transforms.Blocking artifacts. Lapped transforms Hybrid bases in video coding; movement prediction Element-wise quantization: uniform and non-uniform; homogeneous and inhomogeneous zonal, adaptive, Combined discretization-quantization procedures: Vector quantization Adaptive discretization; DPCM with feedback; DPCM with feedback and adaptive quantization; Statistical coding: Shannon-Fano-Haffmen coding; Coding of coordinates of sparse symbols, Run length coding; Coding with tracing contours. Coding color and stereoscopic images. Video coding. Additional literature on image coding: 1. J.S. Lim, Two-dimensional Signal and Image procesing, Prentice Hall, N.J.,1990 2. A. Murat-Tekamp, Digital Video Processing, Prentice Hall, N.J.,1995 3. R.J. Clarke, Digital Compression of Still Images and Video, Academic Press, London, 1996 Problems 1. Explain general quantization and basic principles of signal coding. 2. Explain principles of the design of DPCM coding; DPCM with feedback. 3. Formulate principles and give examples of transform coding methods. 4. Describe statistical coding methods you know. Home work: For an ECG test signal (ecg1024.mat), compute optimal weight coefficient for 1-D predictive coding
Linear transforms Predictive transforms: - Recursive - Multiresolution (image pyramid) decomposition and sub-sampling Element-wise quantization: - Nonuniform homogeneous - Zonal -Adaptive Orthogonal Transforms frame-wise: - DFT - DCT - Walsh - Haar block-wise: - DCT Binary statistical coding - Zig-zag scanning 2-D data - Variable length coding - Rare symbol coding (Run length coding; coding coordinate of rare symbols) Coded binary stream Hybrid predictive and orthogonal transforms Combined decorrelation/quantization: - DPCM with feedback - LZW coding - Adaptive discretization - Vector quantization Classification of digital data compression methods
Input signal - Nonuniform quantizer Statistical encoder Compressed coded signal Predictor DPCM coding flow chart Compressed signal Statistical decoder Decompressed signal + Predictor DPCM decoding flow chart Input signal - Nonuniform quantizer Statistical encoder + Predictor Flow chart of DPCM with feedback coding
Input image: mean=182.8241, stdev=37.4671 Input image histogram 0.015 0.01 0.005 Horizontal differences: mean=0.333927, stdev=8.0463 0 0 50 100 150 200 250 Gray level Histogram of horiz. predict. error 0.3 0.2 0.1 0 0 50 100 150 200 250 Absolute value of the error Vertical differences: mean=0.417656, stdev=8.93394 0.4 Histogram of vert. predict. error 0.3 0.2 0.1 2-D prediction error: mean=0.525653, stdev=7.54791 0 0 50 100 150 200 250 Absolute value of the error Histogram of 2-D predict. error 0.3 0.2 0.1 0 0 50 100 150 200 250 Absolute value of the error
dpcm2d.m: Input image; stdnoise=0 Dpcm2D.m: Input image; stdnoise=0 dpcm2d.m: Input image; stdnoise=20 Output image, mxm=50; BPP=2.5 P=0.3 Output image, mxm=25; BPP=1 P=0.3 Output image, mxm=50; BPP=2.5 P=0.3 Coding/decoding error, STDerr=6.7234 Coding/decoding error, STDerr=15.9943 Coding/decoding error, STDerr=21.2588 dpcm2d.m: Input image; stdnoise=0 Output image, mxm=55; BPP=2 P=0.3 Coding/decoding error, STDerr=11.3159
Input signal samples Highest resolution Output signal samples 2 2 Wavelet decompo-sition coefficients 2 Lowest resolution Signal decomposition Signal reconstruction 2 Unit that performs signal low pass filtering and 2-fold decimation of signal samples Unit that performs signal 2-fold zooming and interpolation The principle of signal coding by sub-band decomposition
Initial (top) and low pass filtered and sub-sampled images Difference signals and lowest level sub-sampled image prepared for quantization and coding Image multi-resolution pyramid
Input image Image fragment 64x64 Fragment DFT spectrum Fragment DCT spectrum Fragment Walsh spectrum 1 DFT (red, Sumsp=0.34), DCT (cyan, Sumsp=0.26), Walsh (green, Sumsp=0.43), Haar (blue, Sumsp=0.42) Fragment Haar spectrum 0.9 0.8 n ts e e f ic i o c a l c tr d spe e e r d o r o f g y E ner 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 10 0 10 1 10 2 10 3 1.. WSzX*WSzY-1
Table of zonal quantization "DCT16" 250 200 150 100 50 Bit allocation table for DCT 16x16 block coding 8 7 6 5 3 3 2 2 2 1 1 1 1 1 0 0 7 6 5 4 3 3 2 2 1 1 1 1 1 0 0 0 6 5 4 3 3 2 2 2 1 1 1 1 1 0 0 0 5 4 3 3 3 2 2 2 1 1 1 1 1 0 0 0 3 3 3 3 2 2 2 1 1 1 1 1 0 0 0 0 3 3 2 2 2 2 2 1 1 1 1 1 0 0 0 0 2 2 2 2 2 2 1 1 1 1 1 0 0 0 0 0 2 2 2 2 1 1 1 1 1 1 1 0 0 0 0 0 2 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0
JPEG CODING STANDARD (A.M. Tekalp, Digital Video Processing, Prentice Hall PTR, Upper Saddle River, NJ, 1995): B/W images: Image is subdivided into 8x8 blocks; DC component is subtracted. 2-D DCT of each block is computed. The DCT coefficients are threshold coded using a quantization matrix and then reordered into 1-D sequence using zigzag scanning The nonzero AC quantized coefficients are Huffman coded; zero coefficients are run length coded. DC coefficient of each block is DPCM coded relative to the DCT coefficient of the previous block Color images: R-G-B components are transformed into Luminance-chrominance space Y- Ch-Cb: Y = 0. 3R + 0. 6G + 0. 1B B Y Cr = + 0. 5 2 R Y Cb = + 0. 5 1. 6 Chrominance channels are subsampled by 2 in both directions. Obtained Y Cr and Cb components are JPEG coded individually
DCT image coding: Input image DCT image coding: Input image Restored image, SzW=8; SzMask=5 Q=4; P=0.2 Restored image, SzW=8; SzMask=5;Q=8; P=0.2 Restored image, SzW=8; SzMask=5;Q=4; P=0.2 Restoration error; std=10.5965; BPP=0.7 Restoration error; std=2.5088; BPP=0.94 Restoration error; std=5.0654; BPP=0.7