Download presentation
Presentation is loading. Please wait.
1
M/2 M N/2 N
2
DFT of images a=[zeros(256,128) ones(256, 128)]; af=fftshift(fft2(a));
imshow(log(1+abs(af)), []); % apply log transform to increase contrast
3
DFT of images (cont.) Exercise#1: show the magnitude of DFT of the following images a=zeros(256, 256); a(78:178, 78:178)=1; [x,y]=meshgrid(-128:127, -128:127); z=sqrt(x.^2+y.^2); c=(z<15); cameraman.tif
4
Filtering : ideal low pass filter
cm=imread('cameraman.tif'); cm=double(cm); cf=fftshift(fft2(cm)); figure, imshow(log(abs(cf)+1), []) cf1=cf.*c; figure, imshow(log(abs(cf1)+1), []) cf1i=ifft2(cf1); figure, imshow(abs(cf1i), []) Ex#2 Perform ideal low pass filtering with cut-off frequency D=5 and D=30 Ex#3 Perform ideal high pass filtering with cut-off frequency D=5 and D=30
5
Filtering: Butterworth filter
[x,y]=meshgrid(-128:127, -128:127); b1=1./(1+((x.^2+y.^2).^0.5/15).^4); Ex#4 Perform Butterworth low-pass and high-pass filtering with cut-off frequency D=15 and n=2 to cameraman
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.