Activity 7: Enhancement in the Frequency Domain

July 10, 2008 at 9:52 am (Uncategorized)

Varying the frequency of a sinusoid image has the effect of changing the peaks of the fft. Higher frequencies correspondes to fft peaks farther from (0,0) which is expeceted.

and their corresponding FT

Rotation of the image consequently rotates the FFT but on the other direction

And multiply sine and cosine results in peaks of coordinates which are the peak of the sine and cosine.

-oOo-

Fingerprint Enhancement

We now apply some filtering techniques to enhance this finger print sample.

clear all;
im=imread(“finger.jpg”);
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’, 30);
filter=fftshift(1-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));

Orignal Image

FT of the original image

Filter

Enhanced fingerprint

FT of the enhanced finger print.

-oOo-

Line Removal In Lunar Image

We have an image here of a images of the moon with strong vertical lines, and to enhance it, we have to remove the those lines.

Looking at the fft, we can see that this white lines are produced by the frequency components encircled (which has symmetry so you can see the corresponding intensity on the right-half) because of the lines’ periodicity. The goal then, is to make a filter to lessen the amplitude of the frequencies encircled*.

I made a mask that cuts off the horizontal line at which the encircled frequencies above lie. However, i retained the a portion near the center to retain some information. The mask looks like this:

The masked fft looks like this:

Finally, the enhanced image looks like this

and there are no more vertical lines present. 🙂

Code:

clear all;
stacksize(4e7);
im=imread(“luna.png”);
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 ,[]);

*Note: The fft is bright because i removed the mean first of the image before performing fft, however, in the actual processing, i did not remove the mean of the image from the image matrix.

I have hints from: http://www.roborealm.com/help/FFT.php

Score: 10. Since i was able to do all of the task, and am proud of the removal of the vertical lines.:)

Collaborators: Julie, Cole, Leil, Benj

1 Comment

  1. Jing said,

    You did the lunar image correctly, well done. The fingerprint is passable. Another way is to enhance the fingerprint is to create a mask that allows only the annular looking part to remain. This is a 10 still.

Leave a comment