Docsity

EECS 556 Imaging Processing Homework 9: Image Quantization and Energy Compaction, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
EECS 556, Imaging Processing, Douglas C. Noll 4/10/2003
Homework #9 – Practice Only – Do no hand in.
1. Lim, Problems 10.9. Let the training vector be (f1, f2) = (1,-1), (0,2), (-1,1), (-2,0). Use
initialization vectors of [(1,-1), (-1,1)], [(-2,0), (0,0)], and [(-2,0), (-.5,1.5)]. Do these yield
the same answer? Why? Compare the results, which is best?
2. Pyramid coder. Suppose we have a 257x257 image that we wish to quantize using pyramid
coding. We will quantize the following images using the following bit rates:
e0(n,m) 1 bit/pixel
e1(n,m) 2 bits/pixel
e2(n,m) 4 bits/pixel
f3(n,m) 6 bits/pixel
e0 is the base of the pyramid and f3 is the top level image. What are the sizes of the four
images to be coded? What is the average bit rate for this example.
3. Energy compaction in transform coding. Download the template hw9_template.m for
use in this problem. This problem will again use the house image from homework #7. We
will examine three different transforms: the DCT, the Hadamard and Haar transforms and we
will use 8x8 blocks. The size 8 1D Haar transform matrix is:
−
−
−
−−−
−−−−
−−
=
22 00
0 02 2
0000
0000
0000
0000
2 200
00 2 2 2222
0000
1111
1111
0000
2222
1111
1111
8
1
8
Haar
The 1D Hadamard transform matrix can be determined from the Matlab hadamard
command. The 2D DCT can be derived from Matlab’s dct command. I would avoid using
the dct function we created in homework #3 as that one was not the unitary form.
a. Implement 8x8 transform for DCT, Hadamard, and Haar. Verify that each is energy
preserving using a sample 8x8 image (sum squared energy in transform domain will be
the same as sub squared energy in the image – or that H*H’ = I)
b. Take the 8x8 transform for all 8x8 blocks in the image and store the transform
coefficients in a 64x5400 array.
c. Determine the variance of each of the coefficients and sort by magnitude.
d. Plot the variances in increasing or decreasing order for each method. Use a log scale
(semilogy) and put all three methods on one plot.
e. Create a plot of the cumulative variance in the n highest coefficients for each method.
Use a linear scale and put all three methods on one plot. Which method has the best
energy compaction.
f. Determine the number of bits that should be assigned to each coefficient for an average
bit rate of 1 bit/pixel. Round to the nearest integer and disallow the assignment of
negative bits/pixel. Which transform method results in the most coefficients coded with
zero bits/pixel.

Partial preview of the text

Download EECS 556 Imaging Processing Homework 9: Image Quantization and Energy Compaction and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

EECS 556, Imaging Processing, Douglas C. Noll 4/10/

Homework #9 – Practice Only – Do no hand in.

  1. Lim, Problems 10.9. Let the training vector be ( f 1 , f 2 ) = (1,-1), (0,2), (-1,1), (-2,0). Use initialization vectors of [(1,-1), (-1,1)], [(-2,0), (0,0)], and [(-2,0), (-.5,1.5)]. Do these yield the same answer? Why? Compare the results, which is best?
  2. Pyramid coder. Suppose we have a 257x257 image that we wish to quantize using pyramid coding. We will quantize the following images using the following bit rates: e 0 ( n , m ) 1 bit/pixel e 1 ( n , m ) 2 bits/pixel e 2 ( n , m ) 4 bits/pixel f 3 ( n , m ) 6 bits/pixel e 0 is the base of the pyramid and f 3 is the top level image. What are the sizes of the four images to be coded? What is the average bit rate for this example.
  3. Energy compaction in transform coding. Download the template hw9_template.m for use in this problem. This problem will again use the house image from homework #7. We will examine three different transforms: the DCT, the Hadamard and Haar transforms and we will use 8x8 blocks. The size 8 1D Haar transform matrix is:

Haar 8

The 1D Hadamard transform matrix can be determined from the Matlab hadamard command. The 2D DCT can be derived from Matlab’s dct command. I would avoid using the dct function we created in homework #3 as that one was not the unitary form. a. Implement 8x8 transform for DCT, Hadamard, and Haar. Verify that each is energy preserving using a sample 8x8 image (sum squared energy in transform domain will be the same as sub squared energy in the image – or that H*H’ = I ) b. Take the 8x8 transform for all 8x8 blocks in the image and store the transform coefficients in a 64x5400 array. c. Determine the variance of each of the coefficients and sort by magnitude. d. Plot the variances in increasing or decreasing order for each method. Use a log scale (semilogy) and put all three methods on one plot. e. Create a plot of the cumulative variance in the n highest coefficients for each method. Use a linear scale and put all three methods on one plot. Which method has the best energy compaction. f. Determine the number of bits that should be assigned to each coefficient for an average bit rate of 1 bit/pixel. Round to the nearest integer and disallow the assignment of negative bits/pixel. Which transform method results in the most coefficients coded with zero bits/pixel.