FRIENDz

FAILURE IS THE SIGN OF SUCCESS!!

Optimized Quantizer with Matlab Program

PDF Optimized Quantizer:
In the case of uniform quantizers, the pdf of the analog sample was assumed to beuniform, and therefore, we obtained the closed form solutions for optimal decision regions and output levels. Moreover, the intervals between any two consecutive decision regions as well as the intervals between any two consecutive output levels were constant. When the pdf of the input analog samples is not uniform, then the quantization steps are not constant and the optimal solutions are obtained by solving the transcendental equations (2.31). This results in a nonuniformquantizer and is referred to as pdf optimized quantizer.
Using Lloyd’s algorithm, we design the quantizers for 3 and 5 bpp. The requantized images at 3 and 5 bpp are shown in Figures 1.a,b, respectively. There are some improvements in the flat areas compared with that of the corresponding uniform quantizer. The SNR values are 20.1 and 33.68 dB for 3 and 5 bpp, respectively, for the nonuniformquantizer, whereas they are 17.3 and 29.04 dB, respectively, for the uniform quantizer. Figure 1.c shows a plot of the decision regions versus output levels of the nonuniformquantizer for
L = 32 levels. The number of pixels belonging to the different output levels is plotted against output levels and is shown in Figure 1.d (top figure), while the bottom Figure 1.d shows the histogram of the input image for the same number of bins—32 in the example. The two are nearly identical and the slight difference is due to small number of bits of quantization. Thus, we have designed the pdf-optimized quantizer for the input image. Overall, we find the nonuniform quantizer to perform much better than the uniform quantizer for the same number of bits of quantization. Another important point of observation is that the iterations converge much faster if we use a difference distortion relative to the previous distortion rather than absolute difference in distortions. In fact, the average number of iterations is 12 when the relative distortion measure is used to check convergence,
Figure 1. An example of a nonuniformquantizer: (a) image requantized to 3 bpp, (b) image
requantized to 5 bpp, (c) plot of input decision regions versus output levels of the nonuniform
quantizer, (d) the top figure is the count of quantized pixels belonging to the different output levels versus output levels, and the bottom figure is histogram of the input image for the same number of levels as in the top figure.
while it is 82 when the absolute difference measure is used for the same ε value of
0.1. The MATLAB code for the Lloyd algorithm is listed below.



No comments:

Post a Comment