Title: DynaMap project
1 DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF
JOENSUU JOENSUU, FINLAND
Image Compression Lecture 8 Scalar
Quantization Alexander Kolesnikov
2Quantization
Any analog quantity that is to be processed by a
digital computer or digital system must be
converted to an integer number proportional to
its amplitude. The conversion process between
analog samples and discrete-valued samples is
called quantization.
Q
Quantizer
Input signal
Quantized signal
3Quantization application areas
Analog-to-digital conversion of signals
(audio,video,etc.)
Quantization of transform coefficients (JPEG,
JPEG2000)
Binarization and multilevel thresholding of
digital images
4Quantization Rounding-off
Any real number x can be rounded-off to the
nearest integer value q(x) round(x)
If k?0.5 ? x ltk 0.5 then q(x)k
5 5.5 6
6.5 7
x6.4
q(x)6.0
x5.6
5Uniform quantizer M8 levels
Input-output characteristic of uniform quantizer
6Nonuniform quantizer as line partition
yi ? Reproduction (reconstructed)
levels ai ? Decision levels (thresholds) Si
ai-1, ai) ? Cell ai -ai-1 ? Cell width
a0 -?, a6 ?.
7Nonuniform quantizer M 8 levels
Input-output characteristic of nonuniform
quantizer
8Quantization error
Input signal x
Quantized signal q(x)
Quantization error e(x) x?q(x)
9Distortion measure
Probability density function (pdf) of x is
p(x) Quantization error e(x) x ? q (x) Mean
(average value) ? of quantization error
Variance ?2 of quantization error as distortion
measure
10Optimal quantization problem
Given a signal x, with probability density
function (or histogram) p(x), find a quantizer
q(x) of x, which minimizes the quantization error
variance ?2
11Formulation of quantization problem (contd)
Optimization problem Find decision aj and
representation levels yj to minimize variance
?2.
12Max-Lloyd solution
13Max-Lloyd Conditions for optimal quantizer
Decision levels ai are midpoints
Representation levels yi are centroids
yj1
aj
yj-1
yj
aj-1
14How to construct optimal quantizer?
- If we have some set of levels, with Max-Lloyd
equations - we can check do these levels provide minimum
of - error variance.
- But these equations dont tell us how to find
the - optimal levels.
?
15Max-Lloyd Iterative algorithm
0. Guess initial set of decision levels aj 1.
Calculate representation levels (centroids)
yj
?
2. Calculate decision levels aj
3. Repeat 1. and 2. until no further variance ?2
reduction
16Iterative algorithm Discrete case
0. Guess initial set of decision levels aj 1.
Calculate representation levels
(centroids) yj
?
2. Calculate decision levels aj
3. Repeat 1. and 2. until no further variance ?2
reduction
17Anyway, how to construct optimal quantizer?
- Iterative algorithm of Lloyd cannot guarante
global - minimum of quantizaton error variance.
- Other heuristic approaches merge, genetic
algorithm, - reinforcement learning, etc.
-
- How to achieve the global minimum
- of the quantization error?
18Summary
1) Uniform and nonuniform quantizers 2) Mean and
variance of quantization error 3) Formulation of
optimal quantization problem 4) Max-Lloyd
Conditions for optimal scalar quantizer 5)
Max-Lloyd Iterative algorithm for scalar
quantizizatoin