Wednesday, November 18, 2009

Write a program to demonstrate Dynamic Range Compression

% Dynamic Range Compression

clear all ;
clc;
aa=imread('saturn.tif');
a=double(aa);
[row,col]=size(a);
for x=1:1:row
for y=1:1:col
c(x,y)=a(x,y)*((-1)^(x+y));%%Needed to center transform%%
end
end
d=abs(fft2(c));
d_log=log(1+d);
%%Plotting
figure(1);
colormap(gray);
imagesc(d);
figure(2);
colormap(gray);
imagesc(d_log);

No comments:

Post a Comment