vector quantization. 2 outline introduction two measurement : quality of image and bit rate...
Post on 20-Dec-2015
226 views
TRANSCRIPT
Vector Quantization
2
outline
Introduction Two measurement : quality of image and bit rat
e Advantages of Vector Quantization over Scalar
Quantization The Linde-Buzo-Gray Algorithm Cell-split algorithm Standard VQ encoding Summary
3
Two measurement Quality of image
M
iji
N
jij
M
i
N
jji
xx
x
SNR
1
2^
1
1 1
^
)(
MSEPSNR
2
10
255log10
M
i
N
jjiij xx
NMMSE
1 1
2^
)()*
1(
4
Two measurement (conti)
The amount of compression will be described in terms of the rate, which will be measured in bits per sample. Suppose we have a codebook of size k, and the input vector is of dimension L. We need to use bits to specify which of the code-vectors was selected. The rate for an L-dimensional vector quantizer with a codebook of size K is .
L
k2log
k2log
5
VQ IntroductionEncoder Decoder Reconstruction
Find closest code-vector
Table lookup
Source output
UnblockGroup into vectors
6
Vector Quantization encoding
VQ was first proposed by Gray in 1984. First, construct codebook which is composed of
codevector. For one vector being encoding, find the nearest
vector in codebook. (determined by Euclidean distance)
Replace the vector by the index in codebook. When decoding, find the vector corresponding b
y the index in codebook.
7
Two important issue
Codevectors in codebook need representative. It affect the quality of de-compressed image a lot. So, how to build a good codebook is an important issue.
Euclidean distance is time-consuming. How to fasten to search for the nearest vector is also an important issue.
8
LBG Algorithm
Proposed by Linde, Buzo, Gray The basic idea is to divide a group of vecto
r. To find a most representative vector from one group. Then gather the vectors to form a codebook.
9
LBG Algorithm1. Divide image into blocks. Then we can view on
e block as k-dimension vector. Ex: block: 4x4 , consider 512x512 image, which can be divided into blocks. Each block can be viewed 16 dimension vector.
2. Arbitrarily choose initial codebook.3. Set these initial codebook as centroids. Other
vectors are grouped. Vectors are in the same group when they have the same nearest centroid.
4. Again, to find new centroids for every group. Get a new codebooks. Repeat 2,3 steps until the centroids of every group converge.
1638444
512512
10
Standard VQ encoding For one vector to be encoding, compute the Eucl
idean distance with every codevectors in codebook, and find the codevector with smallest Euclidean distance.To encode Codebook i codewords
),...,,( 21 kxxxx },...,,{ 21 mYYYY
),...,,( 21 ikiii YYYY
2
11
2
1
)(min)(
k
vlvv
m
l
k
vcvv YxYx
11
Cell split method(細胞分裂法 )
),..,,( 111 xxxX
),..,,( 111 yyyY ),..,,( 111 zzzZ ii xy ii xy
For Y, after grouping, find new centorid
For Z, after grouping, find new centorid
ii
k
yp
pppP
'
),..,,( 21
ii
k
yp
qqqQ
'
),..,,( 21
ii
k
Zr
rrrR
'
),..,,( 21
ii
k
Zs
sssS
'
),..,,( 21
12
algorithm
1. Divide image into blocks. Choose a block (k-dimension) X=(x1, x1,…,x1) as initial vector.
2. Spit X vector into two vector Y=(y1, y1,…,y1) and Z=(z1, z1,…,z1)yi=xi- ,zi=xi+
3. Y and Z are centroids. For all blocks, find the nearest centroid. Re-compute the centroid of blocks and get new centroid Y’ and Z’.
4. Recursively, do Y’ and Z’. Repeat 2 ,3 step. Until find enough number of codevector.
13
14
experienceImage512*512
LBG codebook
Cell spit method =6
Cell spit method =8
Cell spit method =10
PSNR PSNR Gain PSNR Gain PSNR Gain
Girl
Gold
Lena
Pepper
Toys
Tiffancy
average
31.167
29.337
29.080
29.942
28.618
28.268
29.402
31.872 0.705
30.203 0.866
29.927 0.847
30.905 0.963
30.061 1.443
30.669 2.401
30.610 1.204
30.495 0.800
29.456 1.142
28.957 0.621
29.789 1.068
27.861 0.539
30.012 2.338
29.428 1.085
30.562 0.867
29.529 1.218
29.045 0.712
29.828 1.107
28.205 0.873
30.171 2.197
29.557 1.214