Digital Image Processing Chapter 8: Image Compression-3
Digital Image Processing Chapter 8: Image Compression-3
Transform Coding Input Construct n X n Forward Quantizer Symbol Compressed image encoder (M×N) subimages transform image Compressed Symbol Inverse Merge nX n Decompressed image decoder transform subimages image Examples of transformations used for image compression: DFT and DCT
Transform Coding Examples of transformations used for image compression: DFT and DCT
Transform Coding 3 Parameters that effect transform coding performance: 1.Type of transformation 2.Size of subimage 3.Quantization algorithm
Transform Coding 3 Parameters that effect transform coding performance: 1. Type of transformation 2. Size of subimage 3. Quantization algorithm
2D Discrete Transformation Forward transform: W-1N- T(4,)=∑∑fx,y)g(x,y,4,) x=0y=0 where g(xy,u,v)=forward transformation kernel or basis function T(u,v)is called the transform coefficient image. Inverse transform: N-1N-1 f(x,y)=∑∑T(u,)h(x,y,4,) 2u=0v=0 where h(x,y,u,v)=inverse transformation kernel or inverse basis function
2D Discrete Transformation 1 0 1 0 ( , ) ( , ) ( , , , ) N x N y T u v f x y g x y u v Forward transform: 1 0 1 0 ( , ) ( , ) ( , , , ) N u N v f x y T u v h x y u v Inverse transform: where g(x,y,u,v) = forward transformation kernel or basis function where h(x,y,u,v) = inverse transformation kernel or inverse basis function T(u,v) is called the transform coefficient image
Transform Example: ·Fourier Transform Walsh-Hadamard Transform Discrete Cosine Transform Karhunen-Loeve Transform
Transform Example: • Fourier Transform • Walsh-Hadamard Transform • Discrete Cosine Transform • Karhunen-Loeve Transform
Transform Coding Examples Fourier Error DCT coefficients RMS Error =1.28 Hadamard Original image 512x512 pixels Subimage size: 8x8 pixels=64 pixels RMS Error =0.86 Quatization by truncating DCT 50%of coefficients (only 32 max cofficients are kept.) RMS Error=0.68
Transform Coding Examples Original image 512x512 pixels Fourier Hadamard DCT Error Subimage size: 8x8 pixels = 64 pixels Quatization by truncating 50% of coefficients (only 32 max cofficients are kept.) RMS Error = 1.28 RMS Error = 0.86 RMS Error = 0.68
Subimage Size and Transform Coding Performance This experiment: 6.5 Quatization is made by 6 truncating 75%of 5.5 FFT 0.1.Ia a.nenbs-ueaw-1ood 5 transform coefficients 4.5 、WHT 4 3.5 DCT 2 2 1632641282552 Subimage size DCT is the best Size 8x8 is enough
Subimage Size and Transform Coding Performance This experiment: Quatization is made by truncating 75% of transform coefficients DCT is the best Size 8x8 is enough
Subimage Size and Transform Coding Performance Reconstructed DCT Coefficients by using 25% of coefficients (CR=4:1) with 8x8 sub- images Zoomed detail Zoomed detail Subimage size: Original 2x2 pixels Zoomed detail Zoomed detail Subimage size: Subimage size: 4x4 pixels 8x8 pixels
Subimage Size and Transform Coding Performance Zoomed detail Original Reconstructed by using 25% of coefficients (CR = 4:1) with 8x8 subimages DCT Coefficients Zoomed detail Subimage size: 8x8 pixels Zoomed detail Subimage size: 2x2 pixels Zoomed detail Subimage size: 4x4 pixels
Quantization Process:Bit Allocation To assign different numbers of bits to represent transform coefficients based on importance of each coefficient: More importance coefficeitns>assign a large number of bits Less importance coefficients>assign a small number of bits or not assign at all 2 Popular bit allocation methods 1.Zonal coding allocate bits based on the basis of maximum variance 2.Threshold coding allocate bits based on maximum magnitudes of coefficients
Quantization Process: Bit Allocation To assign different numbers of bits to represent transform coefficients based on importance of each coefficient: - More importance coefficeitns assign a large number of bits - Less importance coefficients assign a small number of bits or not assign at all 2 Popular bit allocation methods 1. Zonal coding : allocate bits based on the basis of maximum variance 2. Threshold coding : allocate bits based on maximum magnitudes of coefficients
Example:Results with Different Bit Allocation Methods Reconstructed Reconstructed by using 12.5% by using 12.5% of coefficients of coefficients (8 coefficients (8 coefficients with largest with largest magnitude are variance are used) used) Threshold coding Zonal coding Error Error Zoom details
Example: Results with Different Bit Allocation Methods Reconstructed by using 12.5% of coefficients (8 coefficients with largest magnitude are used) Threshold coding Error Zoom details Reconstructed by using 12.5% of coefficients (8 coefficients with largest variance are used) Zonal coding Error