% Expt 6: To Perform Image Filtering in Frequency Domain (LPF)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

%***********************************************************************************

*
%Name: Shubham Patil
%Division: A Roll no.: 439
%***********************************************************************************
*
% Expt 6 : To perform image filtering in frequency domain [LPF]
clear
close
clc

I= imread('cameraman.tif')
imshow(I);title("Original Image")

//create a low pass filter


H = mkfftfilter(I,"gauss",0.1);
//clf;
//figure();imsurf(H);title("Low pass filter, middle of plot shows the low frequencies components.");

//Take the FFT of the image


Ifft = fft2(im2double(I));
//clf;
figure();imsurf(log(Ifft),128);title("Image imformation on low frequencies - 4 corners")

//Multiply the transform image with the filter


Ishift = Ifft.*fftshift(H);
//clf;
figure();imsurf(log(Ishift),128);title("After applying low pass filter");

//Take the inverse FFT.


Iout= real(ifft(Ishift));
//clf;
figure();imshow(Iout); title("Low Pass Filtered Image");
%*************************************OUTPUT**************************************

You might also like