File Exchange

image thumbnail

Ideal Low-Pass Filtering of an Image

version 1.1 (1.42 KB) by

Ideal Low-Pass Filtering of an Image based on DFT

3 Downloads

Updated

View License

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

Comments and Ratings (7)

Donny Sun

where do my previous comments go?

Donny Sun

i am still a pretty much beginner at MATLAB and DIP, my explanation might contain a lot of flaws. Need you guys' input to make this forum better.

very useful, thanks

wrest12

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

Sufyan

Sufyan (view profile)

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

Updates

1.1

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

MATLAB Release
MATLAB 7.9 (R2009b)
Acknowledgements

Inspired by: Ideal Low Pass Filter

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

IdealLowPass/