clc
clear all
close all
I1=imread('yaleB15_P00A+010E-20.pgm');
I2=imread('yaleB15_P00A+060E-20.pgm');
I3=imread('yaleB23_P00A+000E+90.pgm');
I4=imread('yaleB23_P00A+005E+10.pgm');
J11=imadjust(I1,[],[],0.5);
J12=imadjust(I1,[],[],2.2);
J21=imadjust(I2,[],[],0.5);
J22=imadjust(I2,[],[],2.2);
J31=imadjust(I3,[],[],0.5);
J32=imadjust(I3,[],[],2.2);
J41=imadjust(I4,[],[],0.5);
J42=imadjust(I4,[],[],2.2);
subplot(4,3,1);
imshow(I1);
title('Original Image (a)');
subplot(4,3,2);
imshow(J11);
title('Gamma factor=0.5');
subplot(4,3,3);
imshow(J12);
title('Gamma factor=2.2');
subplot(4,3,4);
imshow(I2);
title('(a) with different illumination');
subplot(4,3,5);
imshow(J21);
title('Gamma factor=0.5');
subplot(4,3,6);
imshow(J22);
title('Gamma factor=2.2');
subplot(4,3,7);
imshow(I3);
title('Original image (b)');
subplot(4,3,8);
imshow(J31);
title('Gamma factor=0.5');
subplot(4,3,9);
imshow(J32);
title('Gamma factor=2.2');
subplot(4,3,10);
imshow(I4);
title('(b) with different illumination');
subplot(4,3,11);
imshow(J41);
title('Gamma factor=0.5');
subplot(4,3,12);
imshow(J42);
title('Gamma factor=2.2');