IP Lab Manual Exp7
IP Lab Manual Exp7
IP Lab Manual Exp7
10 Write a program to compress the image Soft copy of your Photograph CO5
(your own photograph) using energy and knowledge of Image
conservation concept of Discrete cosine compression concepts
transform and calculate RMSE, PSNR
and compression ratio.
11 Case study: Presentation on selected Selected IEEE/ACM paper,
IEEE /ACM paper based on chosen Summary of the paper and PPT
image processing application. presentation
* Students are expected to be ready with the prerequisite before attending the lab
LAB Manual
PART A
(PART A : TO BE REFFERED BY STUDENTS)
Experiment No.07
A.1 Aim:
Write a program to apply 2 level decomposition using LPF and HPF filter Banks on given
image.
A.2 Prerequisite:
1 Matlab programming syntax (Refer the Matlab manual).
2. Knowledge of fundamentals of wavelet and decomposition using filter banks and subsampling.
A.3 Outcome:
After successful completion of this experiment students will be able to
1. Apply 2 level of decomposition using LPF and HPF filter banks and
down sampling on given image.
2. Differentiate the availability of Low and high frequency areas at various
location
3. Identify applications of transforms studied.
A.4 Theory:
A.4.1. Introduction of Wavelet
• Wavelet
– A small wave
• Wavelet Transforms
– Convert a signal into a series of wavelets
– Provide a way for analyzing waveforms, bounded in both frequency and
duration
– Allow signals to be stored more efficiently than by Fourier transform
– Be able to better approximate real-world signals
– Well-suited for approximating data with sharp discontinuities
• Fourier Transform (FT)
– One way to find the frequency content
– Tells how much of each frequency exists in a signal
FT Only Gives what Frequency Components Exist in the Signal. The Time and
Frequency Information can not be Seen at the Same Time. Time-frequency
Representation of the Signal is Needed.
Short Time Fourier Transform (STFT) provides the time and frequency
information
Drawback of STFT
• Unchanged Window
• Dilemma of Resolution
– Narrow window -> poor frequency resolution
– Wide window -> poor time resolution
• Heisenberg Uncertainty Principle
– Cannot know what frequency exists at what time intervals
The drawbacks of STFT is resolved using Wavelet where the dynamic window is
used for signal analysis.
Multi resolution Analysis of images can be done using Wavelets, using the
concept of arithmetic coding, level of decomposition of images using filter banks.
• Multiresolution Analysis
– Analyze the signal at different frequencies with different resolutions
– Good time resolution and poor frequency resolution at high frequencies
– Good frequency resolution and poor time resolution at low frequencies
– More suitable for short duration of higher frequency; and longer duration
of lower frequency components
An example of 2 level decomposition using filter bank.
TASK 1:
**********************
PART B
(PART B : TO BE COMPLETED BY STUDENTS)
(Students must submit the soft copy as per following segments within two hours of the
practical. The soft copy must be uploaded on the Blackboard or emailed to the
concerned lab in charge faculties at the end of the practical in case the there is no Black
board access available)
clc;
clear all;
close all;
img = im2double(rgb2gray(imread('kj1.jpg')));
img=imresize(img,[256,256]);
figure;
subplot(3,3,1);
imshow(img);
title('Original Image');
l= imfilter(img,lp,'conv');
subplot(3,3,2);
imshow(l);
title('Low pass');
h= imfilter(img,hp,'conv');
subplot(3,3,3);
imshow(h);
title('High pass');
l1 = imresize(l,[128,128]);
ll= imfilter(l1,lp,'conv');
subplot(3,3,4);
imshow(ll);
title('LL');
lh= imfilter(l1,hp,'conv');
subplot(3,3,5);
imshow(lh);
title('LH');
h1 = imresize(h,[128,128]);
hl= imfilter(h1,lp,'conv');
subplot(3,3,6);
imshow(hl);
title('HL');
hh= imfilter(h1,hp,'conv');
subplot(3,3,7);
imshow(hh);
title('HH');
sum1 = cat(2,ll,lh);
sum2 = cat(2,hl,hh);
sumc = cat(1,sum1,sum2);
figure;
imshow(sumc);
title('level 1');
lll = imfilter(ll,lp,'conv');
figure;
subplot(3,3,1);
imshow(lll);
title('LLL');
llh = imfilter(ll,hp,'conv');
subplot(3,3,2);
imshow(llh);
title('LLH');
lll1 = imresize(lll,[64,64]);
llll = imfilter(lll1,lp,'conv');
subplot(3,3,3);
imshow(llll);
title('LLLL');
lllh = imfilter(lll1,hp,'conv');
subplot(3,3,4);
imshow(lllh);
title('LLLH');
llh1 = imresize(llh,[64,64]);
llhl = imfilter(llh1,lp,'conv');
subplot(3,3,5);
imshow(llhl);
title('LLHL');
llhh = imfilter(llh1,hp,'conv');
subplot(3,3,6);
imshow(llhh);
title('LLHH');
sum3 = cat(2,llll,lllh);
sum4 = cat(2,llhl,llhh);
sumc1 = cat(1,sum3,sum4);
sum5 = cat(2,sumc1,lh);
sumc2 = cat(1,sum5,sum2);
figure;
imshow(sumc2);
title('level 2');
Input Images:
Output Images:
1. For each level of decomposition as per the procedure discussed in section
A.5.
B.3 Observations and learning:
(Students are expected to comment on the output obtained with clear observations and learning for
each task/ sub part assigned)
In this practical we learnt how the image can be analyzed using multi resolution analysis.
On using LL, we observe slight blurring, on using LH and HL we observe darker image
and on HH we observe sharpening on the boundaries.
A. As in LL, we have the most relevant information left as compared to LH, HL, HH
and when we compare with HH, we can see that the entire image is almost dark.
2. Are we performing multi-resolution analysis of the given image using filter banks?
3. Is it useful in analyzing the content of an image? If yes, suggest any real life
application.
A. Yes we can analyze the different aspects of the image. Applications- tone mapping
and image compression.
How about medical imaging? Will it be useful for content analysis? Explain how.
A. Yes it can be useful for medical imaging. When we see the LLHH, w can see the
presence of most of the objects boundaries.
now when we see LLHH, we get a rough idea about the boundaries not as much as in
HH.
These are so because of the iterative low pass and high pass applied on images in each
level.
B.4 Conclusion:
(Students must write the conclusion as per the attainment of individual outcome listed above and
learning/observation noted in section B.3)
Hence we can conclude that the order in which we apply filters affects the original
image.
Using Wavelets is one typical example of using multi-resolution processing, but multi-
resolution is also used in other applications, such as tone-mapping, and filtering. In
image-processing it is very good if you want to preserve local information (say, edges).
Originally devised for machine vision and image compression. It is a collection of images at
decreasing resolution levels It is a collection of images at decreasing resolution levels.
Approximation pyramid: At each reduced resolution level we have a filtered and down sampled
image down sampled image.
************************