Title: Mini project
1Mini project
Image Compression (using DCT transform)
2Outline
- Transform coding
- 1D-DCT, 2D-DCT
- Quantization
- Uniform
- Codeword assignment
3Source Coder Block Diagram
Encoder
Codeword assignment
Transform (DCT)
Input data
Quantization
Coded bit-string
Decoder
Codeword decoder
Inverse Transform (IDCT)
Output data
4One-dimensional Discrete Cosine Transform (1D-DCT)
The one-dimensional forward Discrete Cosine
Transform (1-D DCT) of N samples is formulated by
for u 0, 1, . . . , N - 1, where The
function f(x) represents the value of the xth
sample of the input signal. F(u) represents a
Discrete Cosine Transformed coefficient for u
0, 1, , N 1 First of all we apply this
transformation to the rows, then to the columns
of image data matrix.
5One-dimensional Inverse Discrete Cosine Transform
(1D-IDCT)
The one-dimensional inverse Discrete Cosine
Transform (1-D IDCT) of N samples is formulated
by
for x 0, 1, . . . , N 1, where
The function f(x) represents the value of the xth
sample of the input signal. F(u) represents a
Discrete Cosine Transformed coefficient for u
0, 1, , N 1 For image decompression we use
this 1D-DCT
6DCT by Rows and Columns
Image Matrix
Transformed Matrix
pixel
DCT coefficient
Transformed Matrix
Transformed Matrix
Transformed Matrix
Transformed Matrix
7Two-dimensional Discrete Cosine Transform (2D-DCT)
- We divide image matrix 8x8 blocks and apply
2D-DCT which is defined by
Inverse DCT
8Partitioning to 8x8 Blocks
9Applying 2D-DCT to 8x8 Block
10Methods Comparison (¼ of all DCT coefficients)
DCT by rows and columns
DCT by 8x8 blocks
11Methods Comparison (1/16 of all DCT coefficients)
DCT by rows and columns
DCT by 8x8 blocks
12Methods Comparison (1/64 of all DCT coefficients)
DCT by rows and columns
DCT by 8x8 blocks
13Methods Comparison
Comparison of Signal to Noise Ratio (SNR)
between different methods
Number of coefficients SNR
1/4 54.2612
1/16 42.8034
1/64 35.1766
Number of coefficients SNR
1/4 52.6321
1/16 39.9717
1/64 30.9931
14Quantization
- Why?
- To reduce the number of different values in the
transformed signal - How?
- Transform data values to values from interval
-128,127 - Round off values to the nearest integer.
- Note
- before quantization we take out some number of
the most significant values, from the transformed
matrix.
15Codeword assignment
- Divide quantized matrix into 8x8 blocks and find
the biggest value of each block - Identify the minimal number of bits necessary to
each block.
16Results
- Original image 512x512 (257KB)
- DCT(rows/2columns/2) quantization -gt 64.2 KB
(compression rate 4) - Codeword assignment -gt 22.4 KB
- (compression rate 2.86)
- Finaly 257KB -gt 22.4KB
- compression rate 11.5
17Original Picture
18Decompressed Picture (compression rate 11.5 )