% These pics are just examples , you should choose a picture and put it to the same
% folder that your matlab (.m) file also exists. After that you should only call it in the
% imread function as shown in the code :
im=imread('SpaceElevator.jpg');
% RGB to gray
I=rgb2gray(im);
% In double format
I=im2double(I);
% computing size m,n
[m n] = size(I);
% Computing s = c * (r ^ gamma) where r and gamma are positive constants
c = 2;
g =[0.5 0.9 3 6];% Gamma Correction Array
for p = 1 : m
for q = 1 : n
I3(p, q) = c * I(p, q).^ g(1);
I4(p, q) = c * I(p, q).^ g(2);
I5(p, q) = c * I(p, q).^ g(3);
I6(p, q) = c * I(p, q).^ g(4);
end
end
figure(3), imshow(I3);title('Power‐law transformation‐darkest');xlabel('Gamma='),xlabel(0.5);
figure(4), imshow(I4);title('Power‐law transformation‐dark');xlabel('Gamma='),xlabel(0.9);
figure(5), imshow(I5);title('Power‐law transformation‐light');xlabel('Gamma='),xlabel(3);
figure(6), imshow(I6);title('Power‐law transformation‐lightest');xlabel('Gamma='),xlabel(6);
Hiç yorum yok:
Yorum Gönder
konuyla ilgili yorumlarınızı bu alana yazabilirsiniz.
you can write your comments to this area about the topic.
potete scrivere i vostri commenti a questa zona circa argomento