DIP S8ECE MODULE5 Part4

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 22

Transform Coding

• A reversible linear transform (such as


Fourier Transform) is used to map the
image into a set of transform coefficients
• These coefficients are then quantized and
coded.
• The goal of transform coding is to
decorrelate pixels and pack as much
information into small number of
transform coefficients.
• Compression is achieved during
quantization not during the transform step
Transform Coding

Software Research
2D Transforms
• Energy packing
– 2D transforms pack most of the energy
into small number of coefficients located
at the upper left corner of the 2D array

Energy
Packing

Software Research
2D Transforms
• Consider an image f(x,y) of size N x N

Forward transform

N 1 N 1
T (u, v)   f ( x, y ) g ( x, y, u , v)
x 0 y 0

u, v  0, 1, 2,..., N  1.
g(x,y,u,v) is the forward transformation kernel or basis functions

Software Research
2D Transforms
• Inverse transform

N 1 N 1
f ( x, y )   T (u, v)h( x, y, u , v)
u 0 v 0

x, y  0, 1, 2,..., N  1.

h(x,y,u,v) is the inverse transformation kernel or basis


functions

Software Research
DCT
One of the most frequently used transformations
for image compression is the DCT

forward

inverse

if u=0 if v=0
if u>0 if v>0
DCT (cont’d)
• Basis set of functions for a 4x4 image
(i.e.,cosines of different frequencies).
DCT (cont’d)
DFT WHT DCT

8 x 8 subimages

64 coefficients
per subimage

50% of the
coefficients
truncated

RMS error: 2.32 1.78 1.13


JPEG Compression
• JPEG is an image compression standard
which was accepted as an international
standard in 1992.
• Developed by the Joint Photographic
Expert Group of the ISO/IEC for coding
and compression of color/gray scale images.
• Yields acceptable compression in the 10:1
range.
• A scheme for video compression based on
JPEG called Motion JPEG (MJPEG) exists
JPEG Compression
(cont’d)
• JPEG uses DCT for handling
interpixel redundancy.

• Modes of operation:
(1) Sequential DCT-based encoding
(2) Progressive DCT-based encoding
(3) Lossless encoding
(4) Hierarchical encoding
JPEG Compression
(Sequential DCT-based encoding)

Entropy
encoder

Entropy
decoder
JPEG Steps
1. Divide the image into 8x8 subimages;

For each subimage do:


2. Shift the gray-levels in the range [-128,
127]
- DCT requires range be centered around 0
3. Apply DCT (i.e., 64 coefficients)
1 DC coefficient: F(0,0)
63 AC coefficients: F(u,v)
Example

(i.e., non-centered
spectrum)
JPEG Steps
4. Quantize the coefficients (i.e.,
reduce the amplitude of coefficients
that do not contribute a lot).

Q(u,v): quantization table


Example
• Quantization Table Q[i][j]
Example (cont’d)

Quantization
JPEG Steps (cont’d)
5. Order the coefficients using zig-
zag ordering
- Place non-zero coefficients first
- Create long runs of zeros (i.e., good for run-length
encoding)
Example
JPEG Steps (cont’d)

6. Form intermediate symbol sequence and encode


coefficients:
6.1 DC coefficients: predictive encoding

6.2 AC coefficients: variable length coding


Module 4

• Image Restoration –
• Degradation model –
• Inverse filtering –
• Wiener Filter –
• Interactive restoration –
• Image analysis & vision -basic
principles only.

You might also like