0% found this document useful (0 votes)
75 views3 pages

Assignment 4

This document contains an assignment on wavelets and multiresolution analysis. It includes 6 questions - constructing approximation and prediction residual pyramids for images; implementing a wavelet transform coder; carrying out 2D Haar wavelet transforms; analyzing orthonormal basis images; and developing MATLAB scripts for Haar discrete wavelet transforms, wavelet-based edge detection, and noise removal.

Uploaded by

Ece Ebru Kaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views3 pages

Assignment 4

This document contains an assignment on wavelets and multiresolution analysis. It includes 6 questions - constructing approximation and prediction residual pyramids for images; implementing a wavelet transform coder; carrying out 2D Haar wavelet transforms; analyzing orthonormal basis images; and developing MATLAB scripts for Haar discrete wavelet transforms, wavelet-based edge detection, and noise removal.

Uploaded by

Ece Ebru Kaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

FCIS – Ain Shams University Prof.

Said Ghoniemy
Computer Systems Department Dr Noha Aly

Post-Graduate: Computer Vision (csys-516) Date: 21/1/2020

Assignment 4_2020_2021_1

Wavelets and MultiResolution Analysis

1. a. Construct a fully populated approximation pyramid (Gaussian Pyramid), and


corresponding prediction residual pyramid for the image f(x,y) shown below

1 23 4

[ ]
f ( x , y )= 5 6 7 8
9 1011 12
13 14 15 16

Use 2×2 block neighborhood averaging for the approximation filter and pixel
replication as interpolation filter
b. Construct a Laplacian pyramid for the “cameraman” image. Find the mean and
standard deviation of the image at the lowest level of the Laplacian pyramid (ie.,
highest resolution image). Compare that with the mean and standard deviation of
the original gray level image.

2. Given the following 8x8 image and a 4-bit version of Lenna image:

a) Find Level-2 of the image pyramid (4x4) using mean method as approximation filter
b) Calculate the laplacian pyramid (prediction residual).
c) onstruct the image from the laplacian pyramid and estimate the reconstruction error

3. Write a MATLAB script for implementing a simplified wavelet transform coder using
the Haar wavelet. Your program should do the following:
1) Read in an image from a file;
2) Perform one stage Haar wavelet decomposition to create 4 subimages;
3) Quantize the wavelet coefficients in each subband using a uniform quantizer with a
specified stepsize Q. For the LL band, you should assume that all coefficients are
non-negative and use a quantizer than assumes the minimal value is 0. For the

This study source was downloaded by 100000866223090 from CourseHero.com on 04-26-2023 01:46:48 GMT -05:00

https://www.coursehero.com/file/131197400/Assignment-4docx/
other bands, you should assume that all coefficients follow a symmetric
distribution with respect to 0.
4) Count the number of non-zeros in the quantized subimages, and determine the
approximate compression ratio defined as:
Total number of pixels
Total number of nonzero coefficients
5) Reconstruct the image using the quantized sub-images. Perform necessary
truncation so that the reconstructed pixel values can be represented by 8 bit
unsigned integers, and save the results in a file.
6) Determine the MSE and PSNR of the reconstructed image.
7) Your program should report the estimated compression ratio and the PSNR, as well
as the decompressed image.
To compute the PSNR, first calculate the mean-squared error using the following
equation:
I
¿
¿ 1 ( m, n )−I 2 (m , n)¿2
¿
¿
∑¿
M ,N
MSE=¿
where M and N are the number of rows and columns in the input image.
R2
PSNR=10 log 10 ( )
MSE
R is the maximum graylevel of the input image

4. a. Carry out a 2D Haar wavelet transform of the 4x4 letter ’O’ image shown below,
using the functions below for forming Approximation, Horizontal details, Vertical
details and Diagonal details. Give the 4x4 image which is the level 1 wavelet
transform.
1 1 1 1
1 0 0 1
1 0 0 1
1 1 1 1

Aprox V-Details H-Details D-Details


0.25 0.25 0.25 -0.25 0.25 0.25 0.25 -0.25
0.25 0.25 0.25 -0.25 -0.25 -0.25 -0.25 0.25

b. Show that the level 2 wavelet transform equals the image given below.
’Haar Level 2 Wavelet Transform’
3 0 1 -1
0 0 1 -1
1 1 -1 1

This study source was downloaded by 100000866223090 from CourseHero.com on 04-26-2023 01:46:48 GMT -05:00

https://www.coursehero.com/file/131197400/Assignment-4docx/
-1 -1 1 -1

5 . You are given the following basis images for 2x2 image patterns:

(a) Show that they form orthonormal basis images.


(b) Calculate the transform coefficients of the image

using these basis images.


(c) Find the reconstructed image Fˆ obtained with the largest two coefficients (in
magnitude).
(d) By observing the appearance of the original and reconstructed images, explain
what is the effect of not using the two coefficients with least values.

6.a. Develop a MATLAB script that reads the input image 'cameraman.tif', computes a 3-
scale Haar discrete wavelet transform (DWT) of the input image and reconstructs
the approximation coefficients for level 2 from the level 3 decomposition and
writes the image to cameraman_A2.png, and reconstructs the approximation
coefficients for level 1 from the level 2 decomposition and writes the image to
cameraman_A1.png. Use the function imread to read the input image in MATLAB.
Use imwrite to write the output image in MATLAB.

a. Wavelet-based edge detection


Develop a MATLAB script that reads the input image 'cameraman.tif' and
computes a 1-, 2-, 3-, and 4-scale Haar DWT of the input image. For each resulting
DWT, set the lowest scale approximation component to zero and compute the
inverse Haar DWT. Comment on the resulting images, including any differences
between them.

b. Wavelet-based noise removal


Develop a MATLAB script called hw4_nr.m that reads the input image 'rice.png',
computes a 2-scale Haar DWT of the input image, sets the highest resolution detail
coefficients to zero, computes the inverse Haar DWT, and writes the results to
'rice_nr.png'. Comment on the results.

This study source was downloaded by 100000866223090 from CourseHero.com on 04-26-2023 01:46:48 GMT -05:00

https://www.coursehero.com/file/131197400/Assignment-4docx/
Powered by TCPDF (www.tcpdf.org)

You might also like