Date: Tue 13 Mar 13:30:21 EST 2007
From: <thj4a@temple.edu> Add To Address Book | This is Spam
Subject: HW6
To: lakamper@temple.edu
Hello,
HW6 is attached.
My part2 did not work, I tried a log transform I found in the
book but it just makes the image black. I even looked at the
Spectrum and I still can't figure out why.
Tom J.
Attachment: HW6.m (1k bytes) Open
%Tom J.
%Part 1 - bascially what you showed me in your office.
abc = imread('hw1.jpg');
f = im2double(abc);
f = f(:,:,3);
FT = fft2(f);
FT2 = FT;
thresh = 1;
diff_measure = .3;
FT = FT.*(abs(FT)>thresh);
result = ifft2(FT);
imshow(result);
q = f - result;
max(q(:));
while max(q(:)) < diff_measure
%The greater the "difference" the higher the threshold - blurry the
%image
%I find the difference being .3 produces good result.
thresh = thresh + 1;
FT = fft2(f);
FT = FT.*(abs(FT)>thresh);
result = ifft2(FT);
imshow(result);
q = f - result;
end
thresh
%Part 2
%GT2 = 2 *log( 1 + double(FT2));
%GT2 = GT2.*(abs(GT2)>thresh);
%result2 = ifft2(GT2);
%imshow(result2);
|