(mask as 3-D and 2-D plots)neeed help plz as soon
Show older comments
Consider the following mask:
H=
[ 0 -1 0
-1 5 -1
0 -1 0]
<<(A)--Find and plot the frequency domain response of the mask as 3-D and 2-D plots. What is the effect of zero padding? Is the response low pass, high pass or band pass function?
<<(B)--Apply this mask to the house image or (any image) from your text book. Does it produce the effect you deduced in part (a)?
2 Comments
Walter Roberson
on 17 Dec 2011
This forum is for MATLAB technical questions, not for people to do homework for you.
ahmad
on 17 Dec 2011
Answers (5)
Image Analyst
on 17 Dec 2011
1 vote
Some tips: You can tell if it's a high pass or high boost filter by seeing if there are negative weights in your kernel. If there are a lot of negative weights, it's a high pass filter. Because the sum of the weights adds to 1, you will have the same average gray level as your original image. A high pass filter would have 4 at the center, and the mean of that image would have been zero because the sum would have been zero. But you have an extra 1 in the center which means you're adding the original image back in. So you don't have any of the three options offered to you. What you have is a high boost filter. You're passing all frequencies and even amplifying the higher frequencies.
Of course the answer to B would be Yes since I'm familiar with filters and I know what to expect. I would not be surprised at the result at all.
I'll leave plotting the frequency response to you. Hint: fft2(), plot(), surf().
3 Comments
ahmad
on 17 Dec 2011
ahmad
on 17 Dec 2011
Walter Roberson
on 17 Dec 2011
fft2: http://www.mathworks.com/help/techdoc/ref/fft2.html
plot: http://www.mathworks.com/help/techdoc/ref/plot.html
surf: http://www.mathworks.com/help/techdoc/ref/surf.html
toot
on 18 Dec 2011
0 votes
thanks alot :Image Analyst for this answre but i have a question: how we can make "zero padding" on mask ? and the question "apply the mask on image" how this will be done ? do we use con2 function? or what ? thanks again
1 Comment
Walter Roberson
on 18 Dec 2011
padded_H = zeros(9,9);
padded_H(2:1+size(H,1), 6:1+size(H,2)) = H;
The above inserts H into padded_H starting at (2,6) and progressing down and to the right.
Yes, you can use conv2(). You could also use filter2() but that will just end up calling conv2() anyhow.
toot
on 19 Dec 2011
0 votes
ok I will try it, thanks alot but I want to be sure about somthing Zero padding when we make it on mask, it will display a black border over the mask is this will be the same in this mask with a "center 5"? thanks agin
Jessica
on 19 Dec 2011
0 votes
will we need to use freqz2() method to find the frequency?? and what do I use fft2() method for? plot is for 2-d and surf is for 3-d what is fft2? please can you guys help us, we are not even taking a matlab course, its image processing course and we didnt take any matlab and we dont have any resources or tutorials. please help us in this question. Thank you <3
1 Comment
Walter Roberson
on 19 Dec 2011
http://www.mathworks.com/matlabcentral/answers/8026-best-way-s-to-master-matlab
Jessica
on 19 Dec 2011
0 votes
and also for applying the mask on the image, do we use imfilter() and give the image and mask as arguments?
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!