Code covered by the BSD License  

Highlights from
Ideal Low-Pass Filtering of an Image

Be the first to rate this file! 27 Downloads (last 30 days) File Size: 1.42 KB File ID: #36674
image thumbnail

Ideal Low-Pass Filtering of an Image

by

 

14 May 2012 (Updated )

Ideal Low-Pass Filtering of an Image based on DFT

| Watch this File

File Information
Description

function im = IdealLowPass(im0,fc)
% fc is the circular cutoff frequency which is normalized to [0 1], that is,
% the highest radian frequency \pi of digital signals is mapped to 1.

[ir,ic,iz] = size(im0);
hr = (ir-1)/2;
hc = (ic-1)/2;
[x, y] = meshgrid(-hc:hc, -hr:hr);

mg = sqrt((x/hc).^2 + (y/hr).^2);
lp = double(mg <= fc);

IM = fftshift(fft2(double(im0)));
IP = zeros(size(IM));
for z = 1:iz
    IP(:,:,z) = IM(:,:,z) .* lp;
end
im = abs(ifft2(ifftshift(IP)));

Acknowledgements

Ideal Low Pass Filter inspired this file.

MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
30 Oct 2013 wrest12

could you please add comments so that people who are new to Matlab can understand it easily

23 Oct 2012 Sufyan

could you please add more comments for each line of code ?

Updates
15 May 2012

misunderstand the reply, and upload this twice, delete one, and update this.

Contact us