Tài liệu Xử lý hình ảnh kỹ thuật số P6 - Pdf 92

141
6

IMAGE QUANTIZATION
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 conver-
sion process between analog samples and discrete-valued samples is called quanti-
zation. The following section includes an analytic treatment of the quantization
process, which is applicable not only for images but for a wide class of signals
encountered in image processing systems. Section 6.2 considers the processing of
quantized variables. The last section discusses the subjective effects of quantizing
monochrome and color images.
6.1. SCALAR QUANTIZATION
Figure 6.1-1 illustrates a typical example of the quantization of a scalar signal. In the
quantization process, the amplitude of an analog signal sample is compared to a set
of decision levels. If the sample amplitude falls between two decision levels, it is
quantized to a fixed reconstruction level lying in the quantization band. In a digital
system, each quantized sample is assigned a binary code. An equal-length binary
code is indicated in the example.
For the development of quantitative scalar signal quantization techniques, let f
and represent the amplitude of a real, scalar signal sample and its quantized value,
respectively. It is assumed that f is a sample of a random process with known proba-
bility density . Furthermore, it is assumed that f is constrained to lie in the range
(6.1-1)
f
ˆ
p f()
a
L
fa
U

DECISION
LEVELS
BINARY
CODE
QUANTIZED
SAMPLE
RECONSTRUCTION
LEVELS
00011111
00011110
255
254
33
32
31
30
3
2
1
0
a
U
a
L
d
j
r
j
d
j

L
a
U

==
SCALAR QUANTIZATION
143
For a large number of quantization levels J, the probability density may be repre-
sented as a constant value over each quantization band. Hence
(6.1-4)
which evaluates to
(6.1-5)
The optimum placing of the reconstruction level within the range to can
be determined by minimization of with respect to . Setting
(6.1-6)
yields
(6.1-7)
FIGURE 6.1-2. Quantization decision and reconstruction levels.
pr
j
()
E pr
j
() fr
j
–()
2
fd
d
j

=
J 1


=
r
j
d
j 1

d
j
E r
j
Ed
r
j
d
------ 0=
r
j
d
j 1
+
d
j
+
2
----------------------=
144

()d
j 1
+
d
j
–()
3
j 0
=
J 1


=
E
d
j
a
U
a
L
–()pf()[]
13⁄

fd
a
L
a
j

pf()[]

pd
j
() d
j
r
j 1

–()
2
pd
j
()– 0==
E∂
r
j

------ 2 fr
j
–()pf()fd
d
j
d
j 1
+

0==
SCALAR QUANTIZATION
145
Upon simplification, the set of equations
(6.1-11a)

–=
r
j
fp f()fd
d
j
d
j 1
+

pf()fd
d
j
d
j 1
+

-------------------------------=
pf()
E
min
f
2
pf() fdr
j
2
pf()fd
d
j
d

Bits d
i
r
i
d
i
r
i
d
i
r
i
d
i
r
i
1 –1.0000 –0.5000 – –0.7979 – –0.7071 0.0000 1.2657
0.0000 0.5000 0.0000 0.7979 0.0000 0.7071 2.0985 2.9313
1.0000 –
2–1.0000 –0.7500 – –1.5104 –1.8340 0.0000 0.8079
–0.5000 –0.2500 –0.9816 –0.4528 –1.1269 –0.4198 1.2545 1.7010
–0.0000 0.2500 0.0000 0.4528 0.0000 0.4198 2.1667 2.6325
0.5000 0.7500 0.9816 1.5104 1.1269 1.8340 3.2465 3.8604
1.0000
3 –1.0000 –0.8750 – –2.1519 – –3.0867 0.0000 0.5016
–0.7500 –0.6250 –1.7479 –1.3439 –2.3796 –1.6725 0.7619 1.0222
–0.5000 –0.3750 –1.0500 –0.7560 –1.2527 –0.8330 1.2594 1.4966
–0.2500 –0.1250 –0.5005 –0.2451 –0.5332 –0.2334 1.7327 1.9688
0.0000 0.1250 0.0000 0.2451 0.0000 0.2334 2.2182 2.4675
0.2500 0.3750 0.5005 0.7560 0.5332 0.8330 2.7476 3.0277

(6.1-15)
for . If f is a zero mean random variable, the proper transformation func-
tion is (4)
(6.1-16)
That is, the nonlinear transformation function is equivalent to the cumulative proba-
bility distribution of f. Table 6.1-2 contains the companding transformations and
inverses for the Gaussian, Rayleigh, and Laplacian probability densities. It should
be noted that nonlinear quantization by the companding technique is an approxima-
tion to optimum quantization, as specified by the Max solution. The accuracy of the
approximation improves as the number of quantization levels increases.
6.2. PROCESSING QUANTIZED VARIABLES
Numbers within a digital computer that represent image variables, such as lumi-
nance or tristimulus values, normally are input as the integer codes corresponding to
the quantization reconstruction levels of the variables, as illustrated in Figure 6.1-1.
If the quantization is linear, the jth integer value is given by
(6.2-1)
where J is the maximum integer value, f is the unquantized pixel value over a
lower-to-upper range of to , and denotes the nearest integer value of the
argument. The corresponding reconstruction value is
(6.2-2)
Hence, is linearly proportional to j. If the computer processing operation is itself
linear, the integer code j can be numerically processed rather than the real number .
However, if nonlinear processing is to be performed, for example, taking the loga-
rithm of a pixel, it is necessary to process as a real variable rather than the integer j
because the operation is scale dependent. If the quantization is nonlinear, all process-
ing must be performed in the real variable domain.
In a digital computer, there are two major forms of numeric representation: real
and integer. Real numbers are stored in floating-point form, and typically have a
large dynamic range with fine precision. Integer numbers can be strictly positive or
bipolar (negative or positive). The two's complement number system is commonly

a
L
a
U
·
[]
N
r
j
a
U
a
L

J
------------------ j
a
U
a
L

2J
------------------ a
L
++=
r
j
r
j
r


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status