You are on page 1of 1

Power Law and Logarithmic Transformations

clc;
clear all;
orig_img=imread('cameraman.tif');
orig_img=double(orig_img);
c=input('c=');
gamma=input('gamma=');
powerlaw_img=c*orig_img.^gamma;
log_img=c*exp(1+orig_img);

subplot(1,3,1)
imshow(uint8(orig_img));
title('input image');

subplot(1,3,2)
imshow(uint8(powerlaw_img));
title('powerlaw image');

subplot(1,3,3)
imshow(uint8(powerlaw_img));
title('log image');

You might also like