ENEE 631 Homework #5

Daniel Garcia-Romero (dgromero.at.umd.edu)

                                                                                                                                                                                          

 

 

1. Function implementation

 

1.    For this homework the EZW algorithm has been used to perform lossy image compression. Only the luminance information has been used in this project. The following functions have been coded to perform the compression:

 

1.    EZW algorithm: my_ezw_compression_version3.m

 

2.    Bit rate computation: my_bit_rate_version2.m

 

3.    Coefficient quantization: my_quantize_coeff.m

 

2.    A Matlab script with the optimum configuration of each of these two functions, for each original image, has been created:

 

1.    Script with the optimum parameters for the original images: script_hw_5.m

 

2. Wavelet selection

 

There are two major factors in wavelet transform coding. The first one is the choice of the wavelet filters and the second the decomposition level of the process. Evaluation of different wavelet filters for image compression has shown the 9/7 biorthogonal filters to be a good choice [Villasenor, 1995]. The use of biorthogonal filters along with a symmetric extension of the image provides a good solution of two well known wavelet transform problems, namely: coefficient expansion and border effects [Usevitch, 2001].

 

The number of decomposition level plays a big role in the achievable compression ratio. The higher the decomposition level the higher the compression ratio. However, there is a computational cost associated with the choice of high decomposition levels. Therefore it is the duty of the system designer to find the balance between the compression ratio and the final computational cost.

 

For this project the 9/7 biorthogonal wavelet filters have been used to yield a 4 level decomposition of the images.

 

 

3.  EZW algorithm

 

The two keys of the EZW algorithm are the use of significant maps (resulting in zero-tree structures) and the concept of successive approximation quantization [Usevitch, 2001]. The first idea offers an efficient solution to the problem of sending the position information, whereas the second produces an embedded bit representation that is very useful for decoding the bit sequence with multiple resolutions.

 

Figures 1 and 2 illustrate these concepts by showing the results of the dominant and subordinate passes of the EZW algorithm for different bit rates. It is interesting to note how the HL, LH and HH sub-bands produce maximum outputs for the spatial locations with horizontal, vertical and diagonal details respectively. It is this multiresolution representation of the image, along with the fact that we are not artificially segmenting the image in square blocks, which allows the wavelet transform algorithms to produce better perceptual results than the block-DCT algorithms for low bit rates [Skodras et al., 2001].

 

 

(a)

EZW second pass dominant map:

red=significant; blue=zero tree root; white=isolated zero, black=not coded

 

(b)

EZW second pass significant map:

Black=significant; White=not significant

 

(c)

EZW second pass reconstructed image. B=0.01 bpp; PSNR= 19.03dB

 

(d)

EZW fourth pass dominant map:

red=significant; blue=zero tree root; white=isolated zero, black=not coded

 

(e)

EZW fourth pass significant map:

Black=significant; White=not significant

 

(f)

EZW fourth pass reconstructed image. B=0.08 bpp; PSNR= 21.54dB

 

(g)

EZW sixth pass dominant map:

red=significant; blue=zero tree root; white=isolated zero, black=not coded

 

(h)

EZW sixth pass significant map:

Black=significant; White=not significant

 

(i)

EZW sixth pass reconstructed image. B=0.85 bpp; PSNR= 27.56dB

 

(j)

EZW ninth pass dominant map:

red=significant; blue=zero tree root; white=isolated zero, black=not coded

(k)

EZW ninth pass significant map:

Black=significant; White=not significant

 

(l)

EZW ninth pass reconstructed image. B=1.90 bpp; PSNR= 40.00dB

 

 

Figure 1. (Left) Dominant map for different passes of the EZW algorithm. (Center) Significant map  for different passes of the EZW algorithm. (Right) Reconstructed images.

 

 

 

 

(a)

EZW second pass dominant map:

red=significant; blue=zero tree root; white=isolated zero, black=not coded

 

(b)

EZW second pass significant map:

Black=significant; White=not significant

 

(c)

EZW second pass reconstructed image. B=0.02 bpp; PSNR= 21.13dB

 

(d)

EZW fourth pass dominant map:

red=significant; blue=zero tree root; white=isolated zero, black=not coded

 

(e)

EZW fourth pass significant map:

Black=significant; White=not significant

 

(f)

EZW fourth pass reconstructed image. B=0.06 bpp; PSNR= 26.97dB

 

(g)

EZW sixth pass dominant map:

red=significant; blue=zero tree root; white=isolated zero, black=not coded

 

(h)

EZW sixth pass significant map:

Black=significant; White=not significant

 

(i)

EZW sixth pass reconstructed image. B=0.26 bpp; PSNR= 33.23dB

 

(j)

EZW ninth pass dominant map:

red=significant; blue=zero tree root; white=isolated zero, black=not coded

(k)

EZW ninth pass significant map:

Black=significant; White=not significant

 

(l)

EZW ninth pass reconstructed image. B=0.96 bpp; PSNR= 40.01dB

 

 

Figure 2. (Left) Dominant map for different passes of the EZW algorithm. (Center) Significant map  for different passes of the EZW algorithm. (Right) Reconstructed images.

 

 

 

 

 

4. Compression ratio and comparison with DCT transform

 

 

The compression ratio achievable subject to a given PSNR is a function of the local content of the images. For images with big uniform areas (high correlation between pixel) and very few textured areas the achievable compression ratio is going to be higher than for the case of images with highly textured areas and few uniform areas. Based on this idea, it is logical to expect a higher compression ratio for the Lena image than for the Baboon image. The results obtained in this homework are in accordance with this and are shown in Table 1.

 

Block size

Lena (Y component)

Baboon (Y component)

 

DCT

EZW

DCT

EZW

8x8

3.17

0.96

4.65

1.90

16x16

2.67

4.37

32x32

2.14

3.98

64x64

1.50

3.46

128x128

1.00

2.81

 

Table 1. Comparison of the number of bits per pixel for the DCT and EZW algorithms for a PSNR=40dB.

 

The results obtained by the EZW algorithm are slightly better than the best result of the DCT compression (128x128 block size). However this is not a totally fair comparison since by increasing the block size of the DCT algorithm the performance could have been better. Nevertheless, the advantage of using wavelet based transform coding arises when dealing with low PSNR (or low bit rates) requirements [Skodras et al., 2001]. Since we are working with images at 40dB PSNR the improvement is not very noticeable.

 

 

5. Conclusions

 

1.    The EZW algorithm provides an efficient solution to the problem of transmitting the position information of the pixels coded.

 

2.    For high PSNR the advantages of the EZW algorithm with respect to the DCT based transformed coding are not very significant.

 

 

6. Bibliography

 

[Usevitch, 2001] B. E. Usevitch, A tutorial on Modern Lossy Wavelet Image compression: Foundations of JPEG 2000, IEEE Signal Processing Magazine. September 2001.

 

[Skodras et al., 2001] A. Skodras, c. Christopoulos and T. Ebrahimi, The JPEG 2000 Still Image Compression Standard, IEEE Signal Processing Magazine. September 2001.

 

[Villasenor, 1995] Wavelet filter evaluation for image compression, IEEE Trans. Image Processing, vol2, pp. 1053-1060. Aug. 1995.