using gaussian filter in an image
Show older comments
hi there im trying to use a gaussian filter to remove 50% of the higher frequencies in a picture could you please tell me what is wrong with this code ?
im=double(imread('image.jpg'))/255;
[m,n]=size(im);
imfreq=fft2(im);
h = fspecial('gaussian',[m n],0.5);
hfreq=fft2(h);
a=ifft2(hfreq.*imfreq);
imshow(a)
thank you in advance!
Answers (1)
Image Analyst
on 13 Jan 2013
1 vote
What do you want to do? Use a Gaussian filter, or remove 50% of the higher frequencies? And what does 50% of the higher frequencies mean? Do you mean you want to block 100% of half of the frequencies in the image? Or do you want to reduce the higher frequencies by 50%? If so, where does that start taking effect?
Categories
Find more on Image 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!