Motivation Large amount of data in images Color video: 200Mb/sec Landsat TM multispectral satellite image: 200MB High potential for compression Redundancy (aka correlation) in images spatial, temporal, spectral storage versus transmission applications source source coder image source source coder channel coder image storage channel retrieved image source decoder retrieved image source decoder channel decoder ECE/OPTI533 Digital Image Processing class notes 288 Dr. Robert A. Schowengerdt 2003
Joint probability plots (scattergrams) between pixels with given horizontal spacing High correlation for close neighbors As pixel separation increases, correlation decreases = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ECE/OPTI533 Digital Image Processing class notes 289 Dr. Robert A. Schowengerdt 2003
Lossy coding IMAGE CODING Some acceptable loss of data, without loss of information Error measures Mean Square Error MSE ( DN ) = Variance ( fˆ f ) Root Mean Square Error RMSE ( DN ) = MSE Normalized Mean Square Error NMSE (% ) = 100 ( MSE ) Variance () f Signal-to-Noise Ratio SNR ( db ) = 10 log( 100 NMSE ) Peak-to-peak SNR PSNR ( db ) = 10 log[ ( f max f min ) 2 MSE ] Problems Error measures don t emphasize visually important features such as contrast edges Can improve correlation of any of these error measures with visual quality by restricting to edge pixels only How to define and quantify image quality? ECE/OPTI533 Digital Image Processing class notes 290 Dr. Robert A. Schowengerdt 2003
example with JPEG coding 1/8 RMSE = 2.91 DN NMSE = 0.16% SNR = 27.9dB 1/16 RMSE = 4.63 DN NMSE = 0.42% SNR = 23.8dB 1/32 RMSE = 7.37 DN NMSE = 1.05% SNR = 19.8ddB ECE/OPTI533 Digital Image Processing class notes 291 Dr. Robert A. Schowengerdt 2003
Run-Length Coding IMAGE CODING typical behavior (image dependent) Simple, image domain, lossy compression algorithm compression ratio Exploits neighboring pixel correlation, line-by-line 0 T Works best for simple, low-frequency content, near-binary images, e.g. faxes DN threshold controls quality loss and compression rate number of runs Look for runs 0 T contiguous pixels with similar values (within threshold of starting pixel value) average runlength Code starting pixel value (Q bits) and length of line ( logn/log2 bits) intrinsic runlength 0 T ECE/OPTI533 Digital Image Processing class notes 292 Dr. Robert A. Schowengerdt 2003
Lossless Coding No data loss Minimal compression (typically 2:1) Example algorithms Run-Length (with zero threshold) Lempel-Ziv-Welsh (LZW) Huffman Coding ECE/OPTI533 Digital Image Processing class notes 293 Dr. Robert A. Schowengerdt 2003
Components of source coder Data transformation waveform coder transform coder image model coder Quantization bits, transform coefficients, or model parameters Codeword Assignment unique bit string for each quantized parameter ECE/OPTI533 Digital Image Processing class notes 294 Dr. Robert A. Schowengerdt 2003
Waveform Coding Pulse Code Modulation (PCM) Image intensity quantized by uniform quantizer At low bit rates (typically less than 4 bits/ pixel), quantization noise appears as false contours in areas of low intensity slope 16 levels 8 levels 4 levels ECE/OPTI533 Digital Image Processing class notes 295 Dr. Robert A. Schowengerdt 2003
Example 2-bit uniform quantizer =1 out 11 3 /2 10 /2 in 01 /2 + in codeword out error 1.2 11 1.5-0.3 1.5 11 1.5 0-2 00-1.5-0.5-0.5 01-0.5 0 bits 00 3 /2 0.5 10 0.5 0 0.6 10 0.5 0.1-0.75 01-0.5-0.25 1.2 11 1.5-0.3 MSE = 0.0628 Alternate representation: mid-rise uniform quantizer bits 00 01 10 11 3 /2 /2 /2 + 3 /2 mid-tread uniform quantizer bits 000 001 010 100 101 3 /2 /2 0 /2 + 3 /2 ECE/OPTI533 Digital Image Processing class notes 296 Dr. Robert A. Schowengerdt 2003
PCM with Nonuniform Quantization Assign quantization levels according to image intensity distribution Small improvement for typical images Depends on nonuniformity of image histogram For example, use CDF as nonlinear transform, i.e. histogram equalization Assigns more levels where there are more pixels source image nonlinear nonlinear coded uniform PCM transform transform -1 image ECE/OPTI533 Digital Image Processing class notes 297 Dr. Robert A. Schowengerdt 2003
PCM with Pseudo-noise Add random noise to image before PCM Subtract same random noise after PCM source uniform PCM image decoded image η(m,n) Removes spatial correlation of quantization noise ECE/OPTI533 Digital Image Processing class notes 298 Dr. Robert A. Schowengerdt 2003
example with 3 bits/pixel and uniform random noise add noise PCM (3bits/pixel) uniform PCM (3bits/pixel) minus noise ECE/OPTI533 Digital Image Processing class notes 299 Dr. Robert A. Schowengerdt 2003
Delta Modulation IMAGE CODING example row-by-row image scan pattern Code difference of neighboring pixels with 1 bit Assume some scan pattern in image Reduces spatial correlation before coding ECE/OPTI533 Digital Image Processing class notes 300 Dr. Robert A. Schowengerdt 2003
Example image: 6 7 8 8 5 9 10 8 6 8 9 7 in difference codeword out error 6 6 1 1-0.3 7 1 1 7 0 8 1 1 8-0.5 8 0 1 9 0 7 9 11 9 differences: 10 2 1 0 9-1 0 0.1 5-4 0-0.25 6 1 1 0-4 -1 2 0 6 1 1-0.3 8 2 1 9 1 1 1 2 1-2 -2-2 2 2 7-2 0 9 2 1 11 2 1 difference 0: codeword = 1 difference < 0: codeword = 0 9-2 0 7-2 0 ECE/OPTI533 Digital Image Processing class notes 301 Dr. Robert A. Schowengerdt 2003