Monday, July 13, 2009

Activity 7. Enhancement in the Frequency Domain



CONVOLUTION THEOREM

Patterns, such as 2 dots, 2 circles and 2 squares, were made using the Microsoft Paint. The Fourier Transform of the patterns were then computed using Scilab. The images and their respective Fourier Transform is shown below. The command used for computing the Fourier Transform is:

S=gray_imread('Sq.bmp');
F=fftshift(fft2(S));
imshow(abs(F),[]); (This is for the square patterns)


For 2 dots:



For 2 Circles:






For 2 Squares:



From the images above, it can be observed that when the width or radius of the square or circle is increased, the size of the white center of the Fourier transform or the whole Fourier transform decreases. Images of a Gaussian function, with varying variances, were then generated using Scilab. The images and their Fourier Transforms are shown below.

For variance = 0.15:


For variance = 0.25:



It was observed that as the variance was increased, the image of the Fourier Transform decreased. The Scilab command used to generate the Gaussian function is:

a=50;
b=50;
u=0.5;
s=0.5;
x=linspace(-1,1,a);
y=linspace(-1,1,b);
[X,Y]=meshgrid(x,y);
G=exp(-((X.*X)/s^2)).*exp(-(Y+u).*(Y+u)./(s^2))
+ exp(-((X.*X)/s^2)).*exp(-(Y-u).*(Y-u)./(s^2)); //+ exp(-((y+u).*(y-u).)/s^2);
//imshow(G,[]);

imshow(abs(fftshift(fft2(G))),[]); (For the Fourier Transform of the Gaussian)

The inverse of the Gaussian was then computed. The image and its Fourier transform is shown below.



FINGERPRINTS

An image of a fingerprint was downloaded from the internet. The image was then converted to grayscale and then the Fourier Transform was then computed using Scilab. The image of the fingerprint was taken from www.freeclipart.com. The images below show the original image, the filter and the enhanced image. From the imgaes below, it can be observed that the blotches from the original image was lessened or removed after applying the filter.




LINE REMOVAL

An image was then enhanced using different filters. The original image, filter and resulting images are shown below.









From the three sets of images above, it can be concluded that the first filter produced the best enhanced image of the original image. The vertical lines were removed when the first filter was used.

CANVAS WEAVE MODELING AND REMOVAL

The selected painting was loaded in Scilab and a filter was created to remove the weave from the canvass. Shown below is the painting, the filter and the improved image. The second filter was more effective in removing the weave pattern than the first filter.





The weave pattern was recreated using the filter. The reconstruction of the weave pattern is shown below.

For finishing this activity, I will give myself 10/10.

**Gary, Raffy and Gilbert helped a lot.

No comments:

Post a Comment