0% found this document useful (0 votes)
653 views3 pages

Image Processing with Low-Pass Filter

The experiment aimed to perform ideal low-pass filtering on a given image. It took the discrete Fourier transform of the image, multiplied it by a low-pass filter transfer function that passed frequencies within a certain distance from the origin and removed higher frequencies, and took the inverse discrete Fourier transform to obtain the smoothed, filtered image. Key steps included computing the DFT, defining a low-pass filter function based on a distance cutoff, multiplying the DFT by the filter, and taking the inverse DFT to return to the image domain.

Uploaded by

Debobrata
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
653 views3 pages

Image Processing with Low-Pass Filter

The experiment aimed to perform ideal low-pass filtering on a given image. It took the discrete Fourier transform of the image, multiplied it by a low-pass filter transfer function that passed frequencies within a certain distance from the origin and removed higher frequencies, and took the inverse discrete Fourier transform to obtain the smoothed, filtered image. Key steps included computing the DFT, defining a low-pass filter function based on a distance cutoff, multiplying the DFT by the filter, and taking the inverse DFT to return to the image domain.

Uploaded by

Debobrata
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Experiment no 4:

Aim of the experiment:

To perform the ideal low pass filtering in the given image.

Theory: Low-pass filters are used for image smoothing and noise reduction.
Matlab code:
clc;
clear all;
close all;
im3=imread('Fig0333(a)(test_pattern_blurring_orig).tif');
im2=double(im3);
% im3=imresize(im1,[200 200]);
[m,n]=size(im2);
im1=[im2, zeros(m,(q-n));zeros((p-m),q)];
%% Multiply with (-1)^(x+y)
for x=1:p
for y=1:q
im(x,y)=(im1(x,y)*((-1)^(x+y)));
end
end
%% Compute DFT
Im=fft2(im);
u=p/2;v=q/2;
%% Distance from origin
D=input('Enter the distance from the origine::');
for i=1:p
for j=1:q
d(i,j)=(((i-u)^2)+((j-v)^2))^.5;
if d(i,j)<=D
H(i,j)=1;
else
H(i,j)=0;
end
end
end
imshow(im2,[]);
figure(2);
imshow(H);

IM=H.*Im;
img=real(ifft2(double(IM)));
for i=1:m
for j=1:n
img1(i,j)=(img(i,j).*((-1)^(i+j)));
end
end
figure(3);
imshow(img1,[]);

Results and Discussion:

Fig :

Original image

Fig: Filter transfer function

Fig: Filtered image

You might also like