Tuesday, July 7, 2009

Activity 5: Fourier Transform Model of Image Formation

Lens as a Fourier Transform

Activity 5.A Familiarization with discrete FFT
Using the built-in FT of scilab, fft2, we are going to obtain the FFT of different patterns.







Left: image of circle, right: Fourier transform of circle. As expected, the FT is a bright spot most intense in the center, imagine imaging uniform disk of same intensity.







Left: image of letter 'A' and right: Fourier tranform of circle. The resulting FT has higher frequency components as expected from the shape of letter A.

Activity 5.B Convolution: Simulation of an imaging device
The representation of an image using an imaging device is not a perfect reconstruction but is a "smeared/convolve" image of the original image. Consider the equation below in frequency space
H=FG
Where F is the transfer function of the imaging device and G is the original image. The convolution of f and g results to the image we actually see. In frequency space, by the Convolution theorem, this is just the multiplication of the linear transform (i.e, Laplace of Fourier) of f and g. We simulate an imaging device using an aperture as our transfer function (i.e, this can be modeled as a lens) and convolve to an image of our choice. Below is the image of letters "VIP" which we are going to image using different sets of apertures.
Original image that we will image.








Left: Convolution of the original image using the aperture on the right. Observe that the resulting image is blurry (i.e., diffraction effect). We can imagine in our real life model, i.e lens, that the aperture did not collect sufficient amount of photons resulting to blurry image or the other way to put it is that the NA (numerical aperture) of the lens is very low.








Left: Convolution of the FT of the aperture in the right with the original image. Observe the significant change in resolution when we increase the size of the aperture. (increase NA)








Left: Convolution of the FT of the aperture in the right with the original image. Further increase in the aperture results to better resolution.








Left: Convolution of the FT of the aperture in the right with the original image. The largest apertuer that we can construct. Although observe that even with the highest NA, we cannot replicate the original image (i.e, presence of blurring at the edges) this is because in the mathematics of Fourier Analysis, in order to perfectly reconstruct we must have infinite coefficients to represent a function, but in our case, we are limited to discrete frequencies.

Activity 5.C: Template Matching using correlation
Correlation is basically finding the overlap of two functions. Thus, it can be used for pattern matching.








"The rain...": Image that we will correlate with the image with letter 'A'. The resulting image results with the all the letter 'A' in the image to have high intensity (appear white in the result).


Activity 6.D: Edge Detection
Using similar concept as above, we can correlate an image with different patterns and thus highlighting those parts that we need depending on the pattern.









Edge detection using the pattern in the right. As observed, the pattern can be deduced to detect all point in the edges.










Edge detection using a vertical pattern, as expected, all the vertical parts of the letter VIP are highlighted.









Edge detection using horizontal pattern. The horizontal edges are highlighted.
It must be noted that the sum of the matrix in the pattern is zero.

For this activity, I give myself a grade of 10 for performing all the requirements needed.

No comments:

Post a Comment