You are on page 1of 12

SVKM’s NMIMS

Mukesh Patel School of Technology Management & Engineering


Computer Engineering Department
Program: B.Tech. Sem VI

Course: Image Processing


List of Experiments
w.e.f. 2nd Jan 2018
Faculty: Dr. Dhirendra Mishra

Exp No. Title Prerequisite* CO#


1 Introduction to Image Processing Refer the Matlab manual, Soft CO1
using Matlab. (Imread, Imwrite, copy of your Photograph
Imshow, size, resize, Addition,
Subtraction, Multiplication and division
of Images)
2. To study the pixel relationship in the Knowledge of 4,8,M CO1
Image (4,8,m connectivity and Use connectivity and Distance
distance measures like Minkowaski measure formulae, Soft copy of
Distance, Eucledian Distance, City your Photograph
Block, Chess board, Sum of absolute
difference. )
3. Implementation of Point Processing CO1
Operations in Spatial Domain. Matlab programming syntax,
a. Negation of an image Knowledge of point processing
b. Thresholding of an image operation, Soft copy of your
Photograph
c. Contrast Stretching of an image
d. Gray level Thresholding
e. Bit Plane slicing.
4 Write a program to enhance the quality Matlab programming syntax, CO1
of image (on your own photograph) by Knowledge of filtering
noise removal (Histogram Equalization, techniques, Soft copy of your
HPF, LPF and Median filtering). Photograph
5 Apply various transforms (Hadamard, Matlab programming syntax CO2
Walsh and DFT) on the image and and knowledge of transforms,
compare its results. Soft copy of your Photograph
6 Apply various transforms ( DCT, DST, Matlab programming syntax CO2
Hartley, Slant) on the image and and knowledge of transforms,
compare its results. Soft copy of your Photograph
7 Perform second level decomposition of Matlab programming syntax CO3
your photograph using Filter Banks and knowledge of Haar
Wavelet, Soft copy of your
Photograph
8 Write a program to segment the given Matlab programming syntax, CO4
medical image using edge detection understaning of medical image,
soft copy of brain tumour CT
techniques: Robert, Prewitt and Sobel Scan image and knowledge of
operators. edge detection operators
9 Write and execute program for given Matlab programming syntax, CO4
noisy finger print image and apply understanding of medical
following image morphological image and knowledge of
operations in given order. morphological operations, Soft
copy of finger print image
a. Opening of image
b. Opening followed by closing

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.

2. Availability of Soft copy of your Photograph for experiment.

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

 Limitation of Fourier Transform

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.

Figure 1: Use of Filter Banks for decomposition

Figure 2: 2 level decomposition of an Input Image


A.5 Procedure/Algorithm:
A.5.1:

TASK 1:

1. Read the i/p image


2. Resize the image to convert it into square matrix.
3. Apply combination of Filter Banks and down sampling to decompose the
image for 2 levels.
4. Display the decomposed images for particular level and display in same matrix
5. Observe the presence of High and low frequency areas in all bands.
6. Further decompose the image to the 2nd level
7. Observe the presence of High and low frequency areas in all bands.
8. Save and close the file and name it as EX7_Task1_your Roll no.m

**********************
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)

Roll No. B044 Name: Kashish Jain


Class : BTech CS Batch : B2
Date of Experiment: 12.3.19 Date of Submission: 12.3.19
Grade : Time of Submission:
Date of Grading:

B.1 Software Code written by student:


(Paste your Matlab code completed during the 2 hours of practical in the lab here)

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');

lp = [1/9 1/9 1/9;1/9 1/9 1/9;1/9 1/9 1/9];


hp = [-1 -1 -1; -1 8 -1; -1 -1 -1];

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');

B.2 Input and Output:


(Paste your program input and output in following format, If there is error then paste the specific
error in the output part. In case of error with due permission of the faculty extension can be given to
submit the error free code with output in due course of time. Students will be graded accordingly.)

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.

1. Why LL band to be decomposed?

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?

A. Yes, by performing sequential low pass and high pass filters.

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.

4. Which type of frequency information is mostly available in particular band in filter


bank? Why?

A. In LLLL – we get the rough image of the object,

in HH- we get a good estimation of the 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.

B.5 Question of Curiosity


(To be answered by student based on the practical performed and learning/observations)
1. What is multi resolution analysis? How it can be achieved using Image pyramid and
filter banks?
A.
Image -> 1/4 Image -> 1/8 Image -> 1/16 Image, etc.

Then you apply and combine filtering at all these resolutions.

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.

Prediction pyramid: A prediction of each high resolution level is obtained by up sampling


(inserting zeros) the previous low resolution up sampling (inserting zeros) the previous low
resolution level (prediction pyramid) and interpolation (filtering).

************************

You might also like