When the frequency of a sinusoid image is varied, the effect is changing the peaks of the fft. Higher frequencies corresponds to fft peaks shifted farther from the origin (0,0) which is expected.
Rotation of the original image causes the FFT to rotate by the same angle
Patterns produced by multiplying or adding the images resulted to peaks of the product and sum.
Fingerprint Enhancement
Designing the right filter depends really on the finger print image. I used the code of Jeric but the results seemed not to fit with my sample image. But changing the cut off frequency made a bit of enhancement of the finger print.
There seems no big enhancement in the image. I think I still didn't used the right filter and the exact cut-off frequency.
Line removal
To remove the vertical lines, fist we have to identify which frequency corresponds to the line as shown in the fft of the image. As expected, the frequency should appear farther from the center of the fft of the image like that in the first part. After identifying the frequency to block, we can now use the right filter and reconstruct the image.
The lines are successfully removed but the quality of the image was affected. Maybe because other frequencies were removed.
Rating: Based from the results of the supposed to be enhancements, I'm not satisfied with what I got. So I'll give myself 8.0 pointd. The key here is to find the right filter which I think I failed to do.
Code: courtesy of Jeric =)
Fingerprint: same with my code:
clear all;
im=imread('C:\Documents and Settings\gpedemonte\Desktop\AP 186\a7\lunar.gif');
im=im2gray(im);
im=im-mean(im);
ff=fft2(im);
h=scf(1);
imshow(abs(fftshift(ff)), []); xset('colormap', hotcolormap(64)); //show fft of image
////make exponential high pass filter
//
filter=mkfftfilter(im, 'exp', 65);
filter=fftshift(filter);
//
//perform enhanment
enhancedft=filter.*ff;
enhanced=real(fft2(enhancedft));
h=scf(2);
imshow(enhanced, []);
h=scf(3);
imshow(abs(fftshift(fft2(enhanced))), []); xset('colormap', hotcolormap(64));
Line removal: by jeric only
clear all;
stacksize(4e7);
im=imread('C:\Documents and Settings\gpedemonte\Desktop\AP 186\a7\lunar.gif');
im=im2gray(im);
im=im; //-mean(im);
ff=fft2(im);
h=scf(1);
ff=fftshift(ff);
imshow(abs(ff), []); xset('colormap', hotcolormap(64));
[x,y]=size(im);
enhancedft=ff;
for i=(x+1)/2-2:(x+1)/2+2
enhancedft(i,1:(y+2)*11/24)=0;
enhancedft(i,(y+2)*13/24:y)=0; //immediate process the ft.
end
enhanced=abs(fft2(enhancedft));
h=scf(2);
imshow(abs(enhancedft), []); xset('colormap', hotcolormap(64));
h=scf(3);
imshow(enhanced ,[]);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment