Thursday, March 12, 2009

Power-Law Transformation

%Power-Law Transformation
% Read a gray scale image and apply the power-law transform for
% gamma = 0.05,0.2,0.67,1.5,2.5,5 and comment your results
clear all;
close all; clc;
f = imread('pout.tif');
f = im2double(f);
[m n]=size(f);
c = 1;
y=input('Gamma value:');
for i=1:m
for j=1:n
s(i,j)=c*(f(i,j)^y);
end
end
figure,imshow(f),title('Original Image');
figure,imshow(s),title('After Power-Law Transformation');

No comments: