<< Chapter < Page
  Image coding   Page 1 / 1
Chapter >> Page >
This module introduces the Haar transform.

Probably the simplest useful energy compression process is the Haar transform. In 1-dimension, this transforms a 2-elementvector x 1 x 2 into y 1 y 2 using:

y 1 y 2 T x 1 x 2
where T 1 2 1 1 1 -1 . Thus y 1 and y 2 are simply the sum and difference of x 1 and x 2 , scaled by 1 2 to preserve energy.

Note that T is an orthonormal matrix because its rows are orthogonal to each other(their dot products are zero) and they are normalised to unit magnitude. Therefore T T . (In this case T is symmetric so T T .) Hence we may recover x from y using:

x 1 x 2 T y 1 y 2
In 2-dimensions x and y become 2 2 matrices. We may transform first the columns of x , by premultiplying by T , and then the rows of the result by postmultiplying by T . Hence:
y T x T
and to invert:
x T y T
To show more clearly what is happening:

If x a b c d then y 1 2 a b c d a b c d a b c d a b c d These operations correspond to the following filtering processes:

  • Top left: a b c d = 4-point average or 2-D lowpass (Lo-Lo) filter.
  • Top right: a b c d = Average horizontal gradient or horizontal highpass and vertical lowpass (Hi-Lo) filter.
  • Lower left: a b c d = Average vertical gradient or horizontal lowpass and vertical highpass (Lo-Hi) filter.
  • Lower right: a b c d = Diagonal curvature or 2-D highpass (Hi-Hi) filter.
To apply this transform to a complete image, we group the pels into 2 2 blocks and apply to each block. The result (after reordering) is shown in . To view the result sensibly, we have grouped all the top left components of the 2 2 blocks in y together to form the top left subimage in , and done the same for the components in the other 3 positions to form thecorresponding other 3 subimages.

Original and the Level 1 Haar transform of the 'Lenna' image.

It is clear from that most of the energy is contained in the top left (Lo-Lo) subimageand the least energy is in the lower right (Hi-Hi) subimage. Note how the top right (Hi-Lo) subimage contains thenear-vertical edges and the lower left (Lo-Hi) subimage contains the near-horizontal edges.

The energies of the subimages and their percentages of the total are:

Lo-Lo Hi-Lo Lo-Hi Hi-Hi
201.73 6 4.56 6 1.89 6 0.82 6
96.5% 2.2% 0.9% 0.4%

Total energy in and = 208.99 6 .

We see that a significant compression of energy into the Lo-Lo subimage has been achieved. However the energy measurements donot tell us directly how much data compression this gives.

A much more useful measure than energy is the entropy of the subimages after a given amount of quantisation. This gives the minimum number of bitsper pel needed to represent the quantised data for each subimage, to a given accuracy, assuming that we use an idealentropy code. By comparing the total entropy of the 4 subimages with that of the original image, we can estimate the compressionthat one level of the Haar transform can provide.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Image coding. OpenStax CNX. Jan 22, 2004 Download for free at http://cnx.org/content/col10206/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Image coding' conversation and receive update notifications?

Ask