Monday, July 6, 2009

Activity 5 Fourier Transform Model of Image Formation

This is an activity which explores the functionality of the built in two-dimensional Fourier Transform of Scilab 4.1.2, fft2(). We will also be showing how this function, along with the convolution and correlation theroems, can be used in various image processing and analysis tasks.

The first task is to familiarize a\ourselves with the fft2()function. Here we first constructed an image of a circle and the letter A (first row). Then using the fft2() and the fftshift() functions we are able to display both of their Fourier Transforms. We know that the results are correct by examining the images. We already know that the fourier transform of a circle or a point is that of an Airy disk and that a larger circle will produce a smaller Airy disk and vice versa. Such results are seen in the images bellow (middle row). Finally we take the fourier transform of the fourier transforms (last row). We know see that the final images are inverted with respect to the original. This is also a common result when using the fourier transform functions of other programming languages. Shifting and scaling constants should be used to be able to recover the original image.

Next we the fft2() function and convolution theorem to model an imaging device with a circular aperture. Here we see that when we use an aperture to image an object, the final image is slightly blurred or deformed. Also we only multiplied the FT of the image to the circular aperture and not its FT since the aperture is already at the focus or the inverse space. We can also see that a larger aperture produces a sharper image which is consistent with our previous results; that is a larger aperture will have a smaller Airy disk FT.







The third task is that we use correlation to locate a pattern with in a certain image. Here we have an image with texts "THE RAIN IN SPAIN STAYS MAINLY IN THE PLAIN" and another image with just "A" of the same text size. We used the fft2() function and implemented the correlation theorem to locate the occurence of the letter A in the texts. After doing correlation and taking its FT again we recover the same image but with locations of "A" highlighted.

The final task is to do edge detection using convolution. Our object is an image of "VIP" and we use different patterns in edge detection. The patterns we used are 3x3 matrices of horizontal, vertical and a point. The resulting images clearly show that the method most accurately detected figures in the image that matched the patterns.



Thank you Martin for talking.

I give myself a grade of 10 for a job well done.





1 comment:

  1. napansin ko lang yung ON sa "Rain In Spain...". wala lang.

    ReplyDelete