optimal quantisation
TRANSCRIPT
-
8/11/2019 Optimal Quantisation
1/25
Intensity Level Resolution
Intensity level resolution refers to the number ofintensity levels used to represent the image
The more intensity levels used, the finer the level of
detail discernable in an imageIntensity level resolution is usually given in terms ofthe number of bits used to store each intensity level
Number of Bits Number of IntensityLevels Examples
1 2 0, 1
2 4 00, 01, 10, 11
4 16 0000, 0101, 1111
8 256 00110011, 01010101
16 65,536 1010101010101010
-
8/11/2019 Optimal Quantisation
2/25
Intensity Level Resolution (cont)
128 grey levels(7 bpp)
64 grey levels(6 bpp)
32 grey levels(5 bpp)
256 greylevels (8 bitsper pixel)
I m a g e s
t a k e n
f r o m
G o n z a l e z
& W o o
d s , D
i g i t a l I m a g e
P r o c e s s
i n g
( 2 0 0 2 )
-
8/11/2019 Optimal Quantisation
3/25
16 grey levels (4 bpp)8 grey levels (3 bpp) 4 grey levels (2 bpp) 2 grey levels (1 bpp)
-
8/11/2019 Optimal Quantisation
4/25
Image quantization
The quantizers transfer function
Quantizer
t1
Quantizersoutputu u
tk tL+1 t2
r L
r k
r 2
r 1
Quantizationerror
tk+1
-
8/11/2019 Optimal Quantisation
5/25
Quantizer
Denote the input brightness range:
Let B the number of bits of the quantizer
L=2 B reconstruction levels
L L L
q
Lt t
q
min Max
L 11
Max L Lt Lt 1min1 ;
maxmin ; L Lu
minmax L L Is the dynamic range of the image
-
8/11/2019 Optimal Quantisation
6/25
The optimal (MSE) quantizer (the Lloyd-Max quantizer)
Lk duu pr ur
t pr t r t t
k
k
t
t uk
k
k uk k k k k
10)()(2
0)()()(
1
221
L
k
t
t uk
M
m
N
n
k
k
duu pr unmunmu MN 1
21
0
1
0
21
)()(,',1
Leibnitz rule : differentiation under an integral
-
8/11/2019 Optimal Quantisation
7/25
t r r
k k k 1
2
k t
t
u
t
t
u
k u|u E
(u)du p
(u)duup
r 1k
k
1k
k
Iterative solution !
-
8/11/2019 Optimal Quantisation
8/25
The uniform quantizer = the optimal quantizer for the uniformgrey level distribution:
otherwise
t ut t t u p L
Lu
0
,1
)( 11
11
r t t t t
t t k
k k
k k
k k
( )
( )1
2 2
1
1
2 2
t t t
k k k 1 1
2
2
qt r k k
-
8/11/2019 Optimal Quantisation
9/25
1
122
2
2 2
qu du
q
q
q
/
/
dB B6
210log SNR
22B
10
2B
2u
121 22/
2/
22 Aduu A
A
Au
Signal variance
Noise variance
SNR
-
8/11/2019 Optimal Quantisation
10/25
(Laplacian)
variance , - mean
2
2
2 2)(
exp2
1)(
uu pu
uu pu exp2)(
22
(Gaussian)
Other possible distributions
-
8/11/2019 Optimal Quantisation
11/25
Illustration of uniform quantization
B=1 => L=2
t1=0 t2=128 t3=256
r1=64
r2=192
Uniform quantizer transfer function
Decision levels
R
e c o n s
t r u c
t i o n
l e v e
l s
0 50 100 150 200 250
0
100
200
300
400
500
600
700
800
900
1000
The histogram of the image
-
8/11/2019 Optimal Quantisation
12/25
Illustration of uniform quantization
B=2 => L=4
Quantized imageThe histogram of the image
0 50 100 150 200 250
0
100
200
300
400
500
600
700
800
900
1000
-
8/11/2019 Optimal Quantisation
13/25
B=3 => L=8; false contours present
Quantized imageImage histogram
0 50 100 150 200 250
0
100
200
300
400
500
600
700
800
900
1000
Illustration of uniform quantization
-
8/11/2019 Optimal Quantisation
14/25
0 50 100 150 200 250
0
100
200
300
400
500
600
700
800
900
1000
Illustration of optimal quantization
Input image histogram
Quantized image (Lloyd max algo)
B=1 => L=2
-
8/11/2019 Optimal Quantisation
15/25
0 50 100 150 200 250
0
100
200
300
400
500
600
700
800
900
1000
Illustration of optimal quantizationB=3 => L=8
Input image histogramQuantized image (Lloyd max algo)
-
8/11/2019 Optimal Quantisation
16/25
-
8/11/2019 Optimal Quantisation
17/25
Uniform quantization, B=4Uniform quantization, B=6
False Contouring
-
8/11/2019 Optimal Quantisation
18/25
16 grey levels (4 bpp) 8 grey levels (3 bpp)4 grey levels (2 bpp) 2 grey levels (1 bpp)
False Contouring
-
8/11/2019 Optimal Quantisation
19/25
Resolution: How Much Is Enough?
The big question with resolution is always howmuch is enough ?
This all depends on what is in the image and
what you would like to do with itKey questions include
Does the image look aesthetically pleasing?Can you see what you need to see within theimage?
-
8/11/2019 Optimal Quantisation
20/25
Resolution: How Much Is Enough?
The picture on the right is fine for counting thenumber of cars, but not for reading the numberplate
-
8/11/2019 Optimal Quantisation
21/25
Intensity Level Resolution(cont)
I m a g e s
t a k e n
f r o m
G o n z a
l e z
& W o o
d s , D
i g i t a l I m a g e
P r o c e s s
i n g
( 2 0 0 2 )
Low Detail Medium Detail High Detail
-
8/11/2019 Optimal Quantisation
22/25
-
8/11/2019 Optimal Quantisation
23/25
)(
)(
)((
)(
))((
))(()'(
)'(
1
1
1
1
1
1
1
1
1
u E
duuup
duuup
duu p
duuup
duu pu E
r pu E
L
k
k
k
k
k
k
k
k
t
t u
L
k
t
t u
t
t u
t
t
u L
k
t
t u
k
L
k k
Quantizer output unbiased
estimator of the input
-
8/11/2019 Optimal Quantisation
24/25
))'((
)|()|'()'(
2
2
1
1
u E
r p
uu E uu E puu E
k
L
k k
k k
L
k
k
Quantization error uncorrelatedwith the output (principle oforthogonality)
-
8/11/2019 Optimal Quantisation
25/25
)()())(()(
))(()())'((
2
2'22
2'22
'
E u E u E u E
u E u E uu E
uu
Average power (variance) ofquantizer output is less thanthat of input