syde 575: digital image processing image compression: jpeg example (variable rate compression)
TRANSCRIPT
![Page 1: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/1.jpg)
SYDE 575: Digital Image Processing
Image Compression:JPEG Example (Variable Rate Compression)
![Page 2: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/2.jpg)
Example of JPEG Compression
Supposed we are given a color image represented in R8G8B8 format.
![Page 3: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/3.jpg)
Color space transformation
Convert image from RGB color space to YcbCr color space.
![Page 4: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/4.jpg)
Chroma Subsampling
Reduce the resolution of Cb and Cr channels by a factor of two in each dimension.
![Page 5: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/5.jpg)
Image sub-division
For each channel, divide the image into 8x8 blocks.
![Page 6: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/6.jpg)
Zero-shift
For each block, shift values by -128 to center around zero
![Page 7: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/7.jpg)
DCT Matrix
DCT Matrix is composed of 8 1-D cosines of varying frequencies (arranged in rows)
![Page 8: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/8.jpg)
DCT Matrix
DCT Matrix is composed of 8 1-D cosines of varying frequencies (arranged in rows)
![Page 9: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/9.jpg)
DCT
Compute DCT
TF=PX Poutput
DCT matrix
input
FX
![Page 10: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/10.jpg)
DCT Memory Requirements
Notice that the DC coefficient (i.e., F(0,0)) requires more than 8 bits to represent Since much of the energy is stored in the DC
coefficient Therefore, internally, more bits are required
for storage during DCT computation This does not increase memory
requirements that much as we are only operating on small 8x8 blocks at a time.
![Page 11: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/11.jpg)
Quantization
Divide DCT coefficients by quantization matrix
Quantized coefficients
F(u,v)R (u,v)=round
Q(u,v)
æ öç ÷è ø
Quantization matrix
Input coefficients
Q=
![Page 12: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/12.jpg)
Quantization
Divide DCT coefficients by quantization matrix Quantized coefficients composed of mostly
zeros and small values
F R
![Page 13: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/13.jpg)
Variable-Length Coding
Arrange coefficients in zig-zag order Apply a run-length encoding scheme Perform variable-length coding (e.g., Huffman)
![Page 14: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/14.jpg)
Decoding
Multiply quantized DCT coefficients by quantization matrix
Quantized coefficients
Quantization matrix
Input coefficients
F(u,v)=R (u,v)Q (u,v)
![Page 15: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/15.jpg)
Decoding
Multiply quantized DCT coefficients by quantization matrix
R F
![Page 16: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/16.jpg)
Decoding
Compute Inverse DCT
output
DCT matrix
input
TX =P FP
F X
![Page 17: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/17.jpg)
Decoding
For each block, shift values by 128 to remove the effects of zero-shift during encoding
![Page 18: SYDE 575: Digital Image Processing Image Compression: JPEG Example (Variable Rate Compression)](https://reader030.vdocument.in/reader030/viewer/2022013115/56649f0c5503460f94c2018b/html5/thumbnails/18.jpg)
KLT Block Transform Compression
• For each 8x8 block, create a 64-d vector• Using all 64-d vectors from the image,
calculate a 64x64 covariance matrix • From the covariance matrix, determine the K
largest eigenvalues that retain a certain % of the energy
• The transformation matrix is then the first K eigenvectors associated with the largest K eigenvalues