
clc 
[fname,fpath]=uigetfile('.*bmp','open');
I1=imread(fname,'bmp');

subplot(3,2,1)
imshow(I1)
title('ORIGINAL IMAGE')
I1=double(I1)/255;

homo=log(I1);      
 

%Low pass filtering


h1 =fspecial('gaussian');
%h1=(1/16)*[1 2 1;2 4 2;1 2 1]; 
I2 = filter2(h1,homo);
subplot(3,2,3)
imshow(I2)
title('lowpassed Filter')

IL=(exp(I2));%-1;

subplot(3,2,4)
imshow(IL)
title(' Intensitty effect of IMAGE')


%Highpass Filtering

%h2= fspecial('sobel');
h2=(-1/4)*[1 2 1;0 -4 0;-1 -2 -1]; 
 
I3 = filter2(h2,homo);
subplot(3,2,5)
imshow(I3)
title('highpassed filter')

IH=(exp(I3));%-1;
subplot(3,2,6)
imshow(IH)
title('Reflction Effect of Image')

en=IL.*IH;

subplot(3,2,2)
imshow(en)
title('IxR after exp ')

