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 [HPF]
clear
close
clc

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

//create a High pass filter


H = mkfftfilter(I,"gauss",0.1);
//clf;
//figure();imsurf(H);title("High 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(1-H);
//clf;
//figure();imsurf(log(Ishift),128);title("After applying High pass filter");

//Take the inverse FFT.


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

You might also like