Monday, July 6, 2009

Activity 5 - Fourier Transform Model of Image Formation

Fourier transform is a linear transformation that results into a representation of a data or object in the inverse of its dimensions. In the case of an image, it generates the spatial frequencies of the figures in the image. The lens actually acts a Fourier transformer of the object or light that it collects and focuses. Using the functions in Scilab (fft2, fftshift and imcorrcoef (convolution)), it is easy to demonstrate the Fourier transform process.
***Please click on the images to enlarge and have a better visual.


Similar to this circular light going through a lens, the image on the focus of the lens is similar to the Fourier transform shown. This resembles the analytical Fourier transform of a circle. Basically, the Fourier transform of the circle can be reconstructed back to the image of a circle. From the inverse space of the Fourier transform, taking the Fourier transform of the inverse space results in the inverse of the inverse space, which is actually the dimension of the original image.

However, using the A-shape, notice that there is an inversion upon applying the the fft2 twice. This was not observed for the circle because it is symmetric. The reason for this can be traced to the analytical form of the Fourier transform. The operation of two forward Fourier transforms is not the same as the operation of a forward and then an inverse Fourier transform, which would result in the same orientation of the original function. What results in the analytical form for a function f(x) upon applying the two forward Fourier transforms is in the form f(-x) (with some factor). It translates to the image being inverted.

Since the Fourier transform is linear, it can also be applied into other operations that have important applications. One is the convolution of two functions. It determines the spreading effect of a certain function on another function. Similar to imaging systems, the optical system used for imaging has a certain function that spreads the function defined by the object resulting in an image that is not exactly the same as the object. Although convolution is a complicated operation, a direct multiplication of the Fourier transforms of the functions in the convolution can actually be done to obtain the transform of the convolution.

Using the Fourier transform as the lens, the circle image can act as the aperture of this simulated imaging system. The multiplication of the Fourier transform of the object and the circle image results to the transform of the convolution. Taking the inverse Fourier, the convolution of the image with the transfer function of the optical system is obtained. Again, there is inversion of the image due to the application of two forward Fourier transforms, instead of one being an inverse. Notice that for larger apertures, a more accurate image of the original object is formed. This demonstrates that finite lens apertures cannot capture all light coming from the object, and therefore, making the reconstruction of the image imperfect.

Another process related to convolution and the Fourier transform is correlation. In comparison with convolution, it is also a linear process which can involve simplification (by multiplication) upon using Fourier transforms (and conjugate of one transform) of the correlated functions. The correlation basically takes the “degree of similarity” between two functions. As a consequence, it has been of great value for use in “template matching, pattern recognition and edge detection.”

As seen in the figure above, the pattern or template ‘A’ is correlated with the statement image. As a result, high correlation values occur at the corresponding location of the statement image with the letters A. This demonstrates correlation for template matching or pattern recognition.

For demonstration of edge detection, the patterns shown above are convolved with the ‘VIP’ image presented previously. The resulting correlation (using imcorrcoef) illustrates a highlight on the parts of the image with the same orientation as that of the pattern – edge detection - which is, basically template matching. It seems as if it takes the projection of the edges of the image onto the axis of the pattern. That is why for the horizontal and vertical patterns, the diagonal and curved edges have lower values, but not entirely zero. For the dot pattern obviously, there is a high correlation value for all the edges.

Reference: Soriano, Activity 5 and 6 Applied Physics 186 Manual, 2009.

For this activity, I would like to give myself a grade of 10. It is fairly easy to do since we were provided with the code. Still, I had done the job right, which is the main objective. Moreover, I also discovered some techniques in the process. I noticed, in Scilab, that you can just create a title first for a plot (or subplot) before you show your image so that no new axes are created (meaning, call the title() command first before the imshow()).

I would like to thank Winsome Chloe Rara, Jica Monsanto and our professor Dr. Maricor Soriano for some assistance in doing this activity.

No comments:

Post a Comment